chore(tests): cleanup jets configs (#9869)

This commit is contained in:
Daniel Suchý
2023-11-11 20:44:37 +01:00
committed by GitHub
parent e063fb5179
commit 7b68bab051
25 changed files with 56 additions and 34 deletions

View File

@@ -14,6 +14,7 @@ module.exports = {
collectCoverage: false,
moduleDirectories: ['node_modules', './'], // './' - ia a home directory for the 'trezor-blockchain-link' library (lib/index.js)
modulePathIgnorePatterns: ['<rootDir>/libDev'],
watchPathIgnorePatterns: ['<rootDir>/libDev'],
transform: {
'^.+\\.js$': 'babel-jest',
'^.+\\.ts$': 'ts-jest',

View File

@@ -29,4 +29,5 @@ module.exports = {
'^.+\\.js$': 'babel-jest',
'^.+\\.ts$': 'ts-jest',
},
watchPathIgnorePatterns: ['<rootDir>/libDev'],
};

View File

@@ -1,4 +1,6 @@
const baseConfig = require('../../jest.config.base');
module.exports = {
preset: '../../jest.config.base.js',
...baseConfig,
testEnvironment: 'node',
};

View File

@@ -1,4 +1,6 @@
const baseConfig = require('../../jest.config.base');
module.exports = {
preset: '../../jest.config.base.js',
...baseConfig,
testEnvironment: 'jsdom',
};

View File

@@ -10,6 +10,8 @@ module.exports = {
collectCoverage: true,
collectCoverageFrom: ['**/src/**/*.ts'],
modulePathIgnorePatterns: ['node_modules', '<rootDir>/lib', '<rootDir>/libDev'],
watchPathIgnorePatterns: ['<rootDir>/libDev'],
testPathIgnorePatterns: ['<rootDir>/libDev'],
transform: {
'^.+\\.ts$': 'ts-jest',
},

View File

@@ -1,5 +1,7 @@
const baseConfig = require('../../jest.config.base');
module.exports = {
preset: '../../jest.config.base.js',
...baseConfig,
moduleNameMapper: {
axios: 'axios/dist/node/axios.cjs',
},

View File

@@ -1,7 +1,7 @@
const { testPathIgnorePatterns } = require('../../jest.config.base');
const { testPathIgnorePatterns, ...baseConfig } = require('../../jest.config.base');
module.exports = {
preset: '../../jest.config.base.js',
...baseConfig,
collectCoverage: true,
testPathIgnorePatterns: [...testPathIgnorePatterns, 'e2e'],
};

View File

@@ -1,5 +1,7 @@
const { testPathIgnorePatterns, ...baseConfig } = require('../../jest.config.base');
module.exports = {
preset: '../../jest.config.base.js',
...baseConfig,
testMatch: ['**/tests/*.test.ts'],
testPathIgnorePatterns: ['e2e'],
testPathIgnorePatterns: [...testPathIgnorePatterns, 'e2e'],
};

View File

@@ -20,4 +20,6 @@ export default {
bail: true,
testEnvironment: 'node',
globals: {},
watchPathIgnorePatterns: ['<rootDir>/libDev'],
testPathIgnorePatterns: ['<rootDir>/libDev'],
};

View File

@@ -1,7 +1,7 @@
const { testPathIgnorePatterns } = require('../../jest.config.base');
const { testPathIgnorePatterns, ...baseConfig } = require('../../jest.config.base');
module.exports = {
preset: '../../jest.config.base.js',
...baseConfig,
testEnvironment: 'node',
collectCoverage: true,
setupFiles: ['<rootDir>/setupJest.ts'],

View File

@@ -1,3 +0,0 @@
module.exports = {
preset: '../../jest.config.base.js',
};

View File

@@ -7,7 +7,7 @@
"main": "src/index",
"scripts": {
"lint:js": "yarn g:eslint '**/*.{ts,tsx,js}'",
"test:unit": "jest --passWithNoTests",
"test:unit": "jest -c ../../jest.config.base.js --passWithNoTests",
"type-check": "tsc --build"
},
"dependencies": {

View File

@@ -11,6 +11,8 @@ module.exports = {
collectCoverage: true,
collectCoverageFrom: ['**/src/**/*.ts', '!**/__tests__/**'],
modulePathIgnorePatterns: ['node_modules', '<rootDir>/lib', '<rootDir>/libDev'],
watchPathIgnorePatterns: ['<rootDir>/libDev', '<rootDir>/lib'],
testPathIgnorePatterns: ['<rootDir>/libDev/', '<rootDir>/lib/'],
transform: {
'^.+\\.ts$': 'ts-jest',
},

View File

@@ -13,6 +13,8 @@ module.exports = {
},
},
modulePathIgnorePatterns: ['node_modules', '<rootDir>/lib', '<rootDir>/libDev'],
watchPathIgnorePatterns: ['<rootDir>/libDev', '<rootDir>/lib'],
testPathIgnorePatterns: ['<rootDir>/libDev/', '<rootDir>/lib/'],
transformIgnorePatterns: ['/node_modules/'],
testMatch: ['**/*.test.(ts|tsx|js)'],
transform: {

View File

@@ -49,7 +49,19 @@ module.exports = {
functions: 47,
},
},
modulePathIgnorePatterns: ['node_modules', '<rootDir>/libDev'],
modulePathIgnorePatterns: ['node_modules'],
watchPathIgnorePatterns: ['<rootDir>/libDev'],
testPathIgnorePatterns: [
'/node_modules/',
'/libDev/',
'/lib/',
'/dist/',
'/build/',
'/build-electron/',
'/coverage/',
'/public/',
],
transformIgnorePatterns: ['/node_modules/(?!d3-(.*)|internmap)/'],
testMatch: ['**/*.test.(ts|tsx|js)'],
transform: {

View File

@@ -2,6 +2,8 @@ export default {
rootDir: './',
moduleFileExtensions: ['ts', 'js'],
modulePathIgnorePatterns: ['node_modules'],
watchPathIgnorePatterns: ['<rootDir>/libDev', '<rootDir>/lib'],
testPathIgnorePatterns: ['<rootDir>/libDev/', '<rootDir>/lib/'],
transform: {
'\\.(js|ts)$': [
'babel-jest',

View File

@@ -1,7 +1,10 @@
const { testPathIgnorePatterns, ...baseConfig } = require('../../jest.config.base');
module.exports = {
preset: '../../jest.config.base.js',
...baseConfig,
testEnvironment: 'node',
collectCoverage: true,
collectCoverageFrom: ['src/**/*.ts'],
testPathIgnorePatterns: ['libDev', 'e2e'],
testPathIgnorePatterns: [...testPathIgnorePatterns, 'e2e'],
watchPathIgnorePatterns: ['<rootDir>/libDev', '<rootDir>/lib'],
};

View File

@@ -10,6 +10,8 @@ module.exports = {
collectCoverage: true,
collectCoverageFrom: ['**/src/**/*.ts'],
modulePathIgnorePatterns: ['node_modules', '<rootDir>/lib', '<rootDir>/libDev'],
watchPathIgnorePatterns: ['<rootDir>/libDev', '<rootDir>/lib'],
testPathIgnorePatterns: ['<rootDir>/libDev/', '<rootDir>/lib/'],
setupFiles: ['./tests/jest.setup.js'],
transform: {
'^.+\\.ts$': 'ts-jest',

View File

@@ -1,3 +0,0 @@
module.exports = {
preset: '../../jest.config.base.js',
};

View File

@@ -8,8 +8,8 @@
"scripts": {
"lint:js": "yarn g:eslint '**/*.{ts,tsx,js}'",
"type-check": "tsc --build tsconfig.json",
"test:unit": "jest",
"test-unit:watch": "jest -o --watch"
"test:unit": "jest -c ../../jest.config.base.js",
"test-unit:watch": "jest -c ../../jest.config.base.js -o --watch"
},
"dependencies": {
"@reduxjs/toolkit": "1.9.5",

View File

@@ -1,3 +0,0 @@
module.exports = {
preset: '../../jest.config.base.js',
};

View File

@@ -8,8 +8,8 @@
"scripts": {
"lint:js": "yarn g:eslint '**/*.{ts,tsx,js}'",
"type-check": "tsc --build",
"test:unit": "jest",
"test-unit:watch": "jest -o --watch"
"test:unit": "jest -c ../../jest.config.base.js",
"test-unit:watch": "jest -c ../../jest.config.base.js -o --watch"
},
"dependencies": {
"@suite-common/suite-config": "workspace:*",

View File

@@ -1,3 +0,0 @@
module.exports = {
preset: '../../jest.config.base.js',
};

View File

@@ -8,8 +8,8 @@
"scripts": {
"lint:js": "yarn g:eslint '**/*.{ts,tsx,js}'",
"type-check": "tsc --build",
"test:unit": "jest",
"test-unit:watch": "jest -o --watch"
"test:unit": "jest -c ../../jest.config.base.js",
"test-unit:watch": "jest -c ../../jest.config.base.js -o --watch"
},
"dependencies": {
"@ethereumjs/common": "^4.1.0",

View File

@@ -1,3 +0,0 @@
module.exports = {
preset: '../../jest.config.base.js',
};