-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(test): add tests for react components
- Loading branch information
Showing
17 changed files
with
46,159 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ src/composer.lock | |
/crowdin.deb | ||
crowdin.yml | ||
node_modules/ | ||
.npmrc | ||
.npmrc | ||
coverage/ |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
node: 'current', | ||
}, | ||
}, | ||
], | ||
'@babel/preset-react', | ||
'@babel/preset-typescript', | ||
], | ||
plugins: [ | ||
function () { | ||
return { | ||
visitor: { | ||
MetaProperty(path) { | ||
/** | ||
replace "import.meta" by "process" to access env in jest test | ||
env for vite : https://vitejs.dev/guide/env-and-mode.html#env-variables | ||
issue for jest : https://github.com/vitejs/vite/issues/1149 | ||
**/ | ||
path.replaceWithSourceString('process') | ||
}, | ||
}, | ||
} | ||
}, | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
/* eslint-disable import/no-anonymous-default-export */ | ||
/* | ||
* For a detailed explanation regarding each configuration property and type check, visit: | ||
* https://jestjs.io/docs/configuration | ||
*/ | ||
const { resolve } = require('path') | ||
const coverageThreshold = require('./threshold-js.json') | ||
const baseDir = __dirname | ||
module.exports = { | ||
clearMocks: true, | ||
collectCoverage: true, | ||
coverageDirectory: 'coverage', | ||
coverageProvider: 'babel', | ||
testEnvironment: 'jsdom', | ||
moduleDirectories: ['./node_modules'], | ||
moduleNameMapper: { | ||
'\\.(css|less|scss|sss|styl)$': resolve(baseDir, 'node_modules', 'jest-css-modules'), // Equivalent of identity-obj-proxy | ||
}, | ||
|
||
coverageThreshold: { | ||
global: coverageThreshold, | ||
}, | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.