elm-optimize-level-2/jest.config.js
Jeroen Engels c4972e720b Avoid running tests twice
Jest was running both the test/xyz.ts version of the test files and
the compiled dist/test/xyz.js version of the test. Removing this
duplication also prevents the tests from failing.
2021-11-20 13:57:18 +01:00

21 lines
594 B
JavaScript

function createJestConfig(_, rootDir = __dirname) {
const config = {
transform: {
'.(ts|tsx)$': 'ts-jest'
},
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'],
moduleFileExtensions: ['ts', 'js'],
collectCoverageFrom: ['src/**/*.{ts,tsx,js,jsx}'],
testMatch: ['<rootDir>/test/*.(spec|test).ts'],
testURL: 'http://localhost',
rootDir,
watchPlugins: [
require.resolve('jest-watch-typeahead/filename'),
require.resolve('jest-watch-typeahead/testname'),
],
};
return config;
}
module.exports = createJestConfig();