jan/web/jest.config.js
Louis 302b73ae73
test: add web helpers, services, utils tests (#3669)
* test: add web helpers tests

* fix: coverage report

* test: add more tests

* test: add more generated tests

* chore: add more tests

* test: add more tests
2024-09-20 14:24:51 +07:00

29 lines
778 B
JavaScript

const nextJest = require('next/jest')
/** @type {import('jest').Config} */
const createJestConfig = nextJest({})
// Add any custom config to be passed to Jest
const config = {
testEnvironment: 'jsdom',
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
'^.+\\.(js|jsx)$': 'babel-jest',
},
moduleNameMapper: {
// ...
'^@/(.*)$': '<rootDir>/$1',
},
// Add more setup options before each test is run
// setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
runner: './testRunner.js',
collectCoverageFrom: ['./**/*.{ts,tsx}'],
}
// https://stackoverflow.com/a/72926763/5078746
// module.exports = createJestConfig(config)
module.exports = async () => ({
...(await createJestConfig(config)()),
transformIgnorePatterns: ['/node_modules/(?!(layerr)/)'],
})