aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/jest.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/jest.config.js')
-rw-r--r--server/sonar-web/jest.config.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/server/sonar-web/jest.config.js b/server/sonar-web/jest.config.js
new file mode 100644
index 00000000000..37a3d45c5ad
--- /dev/null
+++ b/server/sonar-web/jest.config.js
@@ -0,0 +1,32 @@
+module.exports = {
+ coverageDirectory: '<rootDir>/coverage',
+ collectCoverageFrom: ['src/main/js/**/*.{ts,tsx,js}'],
+ coverageReporters: ['lcovonly', 'text'],
+ globals: {
+ 'ts-jest': {
+ diagnostics: {
+ ignoreCodes: [151001]
+ }
+ }
+ },
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
+ moduleNameMapper: {
+ '^.+\\.(md|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
+ '<rootDir>/config/jest/FileStub.js',
+ '^.+\\.css$': '<rootDir>/config/jest/CSSStub.js',
+ '^Docs/@types/types$': '<rootDir>/../sonar-docs/src/@types/types.d.ts',
+ '^Docs/(.*)': '<rootDir>/../sonar-docs/src/$1'
+ },
+ setupFiles: [
+ '<rootDir>/config/polyfills.js',
+ '<rootDir>/config/jest/SetupEnzyme.js',
+ '<rootDir>/config/jest/SetupTestEnvironment.ts'
+ ],
+ snapshotSerializers: ['enzyme-to-json/serializer'],
+ testPathIgnorePatterns: ['<rootDir>/config', '<rootDir>/node_modules', '<rootDir>/scripts'],
+ testRegex: '(/__tests__/.*|\\-test)\\.(ts|tsx|js)$',
+ transform: {
+ '\\.js$': 'babel-jest',
+ '\\.(ts|tsx)$': 'ts-jest'
+ }
+};