42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
module.exports = {
|
|
projects: [
|
|
{
|
|
displayName: 'unit',
|
|
testEnvironment: 'node',
|
|
testMatch: ['**/tests/unit/**/*.test.js'],
|
|
setupFilesAfterEnv: ['<rootDir>/tests/setup.js'],
|
|
testTimeout: 10000,
|
|
transformIgnorePatterns: [
|
|
'node_modules/(?!(@scure|@otplib|otplib|@noble)/)'
|
|
],
|
|
},
|
|
{
|
|
displayName: 'integration',
|
|
testEnvironment: 'node',
|
|
testMatch: ['**/tests/integration/**/*.test.js'],
|
|
setupFilesAfterEnv: ['<rootDir>/tests/integration-setup.js'],
|
|
testTimeout: 30000,
|
|
transformIgnorePatterns: [
|
|
'node_modules/(?!(@scure|@otplib|otplib|@noble)/)'
|
|
],
|
|
},
|
|
],
|
|
// Run tests sequentially to avoid module cache conflicts between unit and integration tests
|
|
maxWorkers: 1,
|
|
coverageDirectory: 'coverage',
|
|
collectCoverageFrom: [
|
|
'**/*.js',
|
|
'!**/node_modules/**',
|
|
'!**/coverage/**',
|
|
'!**/tests/**',
|
|
'!jest.config.js'
|
|
],
|
|
coverageReporters: ['text', 'lcov', 'html'],
|
|
coverageThreshold: {
|
|
global: {
|
|
lines: 80,
|
|
statements: 80
|
|
}
|
|
}
|
|
};
|