mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 14:19:58 +00:00
remove duplication of all jest configs (#3375)
* use jest-preset for all but app * separate properties that are the same as the preset for some reason, it doesn't work. you get: ``` Preset ../../jest-preset.js not found. ``` This needs to be investigated. * removes unused/unneeded npm script in `app`, `test:jest`
This commit is contained in:
parent
3b757251c9
commit
5fe277ee02
@ -1,20 +1,16 @@
|
||||
/** @type { import('@jest/types').Config.InitialOptions } */
|
||||
module.exports = {
|
||||
collectCoverage: false,
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
isolatedModules: true,
|
||||
},
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
testMatch: [
|
||||
'**/*.test.ts',
|
||||
],
|
||||
verbose: false,
|
||||
resetMocks: true,
|
||||
resetModules: true,
|
||||
collectCoverage: false,
|
||||
testEnvironment: 'node',
|
||||
testRegex: ['.+\\.test\\.tsx?$'],
|
||||
transform: { '^.+\\.tsx?$': 'ts-jest' },
|
||||
verbose: false,
|
||||
};
|
@ -1,35 +1,29 @@
|
||||
/** @type { import('@jest/types').Config.InitialOptions } */
|
||||
module.exports = {
|
||||
// preset: '../../jest-preset.js', // DOES NOT WORK
|
||||
// same as preset:
|
||||
collectCoverage: false,
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
isolatedModules: true,
|
||||
},
|
||||
},
|
||||
testEnvironment: 'jsdom',
|
||||
cache: false,
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
verbose: true,
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
resetMocks: true,
|
||||
resetModules: true,
|
||||
testRegex: ['.+\\.test\\.tsx?$'],
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: ['app/**/*.{js,jsx,ts,tsx}'],
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
coverageReporters: ['text-summary', 'lcov'],
|
||||
setupFiles: [
|
||||
'./__jest__/setup.ts',
|
||||
],
|
||||
setupFilesAfterEnv: [
|
||||
'./__jest__/setup-after-env.ts',
|
||||
],
|
||||
transform: { '^.+\\.tsx?$': 'ts-jest' },
|
||||
|
||||
// extended from preset:
|
||||
cache: false,
|
||||
modulePathIgnorePatterns: ['<rootDir>/network/.*/__mocks__'],
|
||||
rootDir: 'app',
|
||||
setupFiles: ['./__jest__/setup.ts'],
|
||||
setupFilesAfterEnv: ['./__jest__/setup-after-env.ts'],
|
||||
testEnvironment: 'jsdom',
|
||||
verbose: true,
|
||||
moduleNameMapper: {
|
||||
'\\.(css|less|png)$': '<rootDir>/__mocks__/dummy.ts',
|
||||
'^worker-loader!': '<rootDir>/__mocks__/dummy.ts',
|
||||
},
|
||||
modulePathIgnorePatterns: [
|
||||
'<rootDir>/network/.*/__mocks__',
|
||||
],
|
||||
rootDir: 'app',
|
||||
};
|
||||
|
@ -9,8 +9,7 @@
|
||||
"main": "app/main.min.js",
|
||||
"scripts": {
|
||||
"clean": "tsc --build tsconfig.webpack.json --clean && tsc --build tsconfig.build.json --clean",
|
||||
"test": "npm run test:jest",
|
||||
"test:jest": "cross-env NODE_ENV=test jest --silent",
|
||||
"test": "jest",
|
||||
"test-appveyor": "npm run test -- --maxWorkers 1",
|
||||
"start:electron": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" cross-env NODE_ENV=development webpack --config webpack/webpack.config.electron.ts && electron .",
|
||||
"start:dev-server": "cross-env TS_NODE_PROJECT=\"tsconfig.webpack.json\" webpack-dev-server --config webpack/webpack.config.development.ts",
|
||||
|
@ -1,21 +1,6 @@
|
||||
/** @type { import('@jest/types').Config.InitialOptions } */
|
||||
module.exports = {
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
isolatedModules: true,
|
||||
},
|
||||
},
|
||||
testEnvironment: 'jsdom',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
preset: '../../jest-preset.js',
|
||||
setupFilesAfterEnv: ['./src/jest/setup-after-env.ts'],
|
||||
verbose: false,
|
||||
resetMocks: true,
|
||||
resetModules: true,
|
||||
testRegex: ['.+\\.test\\.tsx?$'],
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
coverageReporters: ['text-summary', 'lcov'],
|
||||
testEnvironment: 'jsdom',
|
||||
};
|
||||
|
@ -1,17 +1,4 @@
|
||||
/** @type { import('@jest/types').Config.InitialOptions } */
|
||||
module.exports = {
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
isolatedModules: true,
|
||||
},
|
||||
},
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
testRegex: ['.+\\.test\\.ts$'],
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
coverageReporters: ['text-summary', 'lcov'],
|
||||
preset: '../../jest-preset.js',
|
||||
};
|
||||
|
@ -1,17 +1,4 @@
|
||||
/** @type { import('@jest/types').Config.InitialOptions } */
|
||||
module.exports = {
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
isolatedModules: true,
|
||||
},
|
||||
},
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
testRegex: ['.+\\.test\\.ts$'],
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
coverageReporters: ['text-summary', 'lcov'],
|
||||
preset: '../../jest-preset.js',
|
||||
};
|
||||
|
@ -1,29 +1,8 @@
|
||||
/** @type { import('@jest/types').Config.InitialOptions } */
|
||||
module.exports = {
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
isolatedModules: true,
|
||||
},
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
testMatch: [
|
||||
'**/*.test.ts',
|
||||
],
|
||||
verbose: false,
|
||||
resetMocks: true,
|
||||
resetModules: true,
|
||||
|
||||
setupFiles: [
|
||||
'./src/jest/setup.ts',
|
||||
],
|
||||
preset: '../../jest-preset.js',
|
||||
collectCoverage: true,
|
||||
coveragePathIgnorePatterns: [
|
||||
'/node_modules/',
|
||||
],
|
||||
coveragePathIgnorePatterns: ['/node_modules/'],
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
branches: 88,
|
||||
@ -32,4 +11,5 @@ module.exports = {
|
||||
statements: 95,
|
||||
},
|
||||
},
|
||||
setupFiles: ['./src/jest/setup.ts'],
|
||||
};
|
||||
|
@ -1,17 +1,4 @@
|
||||
/** @type { import('@jest/types').Config.InitialOptions } */
|
||||
module.exports = {
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
isolatedModules: true,
|
||||
},
|
||||
},
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
testRegex: ['.+\\.test\\.ts$'],
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
coverageReporters: ['text-summary', 'lcov'],
|
||||
preset: '../../jest-preset.js',
|
||||
};
|
||||
|
@ -1,20 +1,4 @@
|
||||
/** @type { import('@jest/types').Config.InitialOptions } */
|
||||
module.exports = {
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
isolatedModules: true,
|
||||
},
|
||||
},
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
testMatch: [
|
||||
'**/*.test.ts',
|
||||
],
|
||||
verbose: false,
|
||||
resetMocks: true,
|
||||
resetModules: true,
|
||||
collectCoverage: false,
|
||||
preset: '../../jest-preset.js',
|
||||
};
|
||||
|
@ -1,17 +1,4 @@
|
||||
/** @type { import('@jest/types').Config.InitialOptions } */
|
||||
module.exports = {
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
isolatedModules: true,
|
||||
},
|
||||
},
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
testRegex: ['.+\\.test\\.ts$'],
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
coverageReporters: ['text-summary', 'lcov'],
|
||||
preset: '../../jest-preset.js',
|
||||
};
|
||||
|
@ -1,17 +1,4 @@
|
||||
/** @type { import('@jest/types').Config.InitialOptions } */
|
||||
module.exports = {
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
isolatedModules: true,
|
||||
},
|
||||
},
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
testRegex: ['.+\\.test\\.ts$'],
|
||||
collectCoverage: false,
|
||||
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
coverageReporters: ['text-summary', 'lcov'],
|
||||
preset: '../../jest-preset.js',
|
||||
};
|
||||
|
@ -1,19 +1,4 @@
|
||||
/** @type { import('@jest/types').Config.InitialOptions } */
|
||||
module.exports = {
|
||||
globals: {
|
||||
'ts-jest': {
|
||||
isolatedModules: true,
|
||||
},
|
||||
},
|
||||
testEnvironment: 'node',
|
||||
transform: {
|
||||
'^.+\\.tsx?$': 'ts-jest',
|
||||
},
|
||||
testRegex: ['.+\\.test\\.ts$'],
|
||||
collectCoverage: false,
|
||||
resetMocks: true,
|
||||
resetModules: true,
|
||||
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
|
||||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
|
||||
coverageReporters: ['text-summary', 'lcov'],
|
||||
preset: '../../jest-preset.js',
|
||||
};
|
||||
|
@ -2,6 +2,6 @@
|
||||
"extends": "./tsconfig.base.json",
|
||||
"include": [
|
||||
".eslintrc.js",
|
||||
"jest.config.js"
|
||||
"jest-preset.js"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user