Initial Commmit
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 38s
All checks were successful
Publish to Private NPM Registry / publish (push) Successful in 38s
This commit is contained in:
commit
170b1a0cec
14 changed files with 4777 additions and 0 deletions
36
jest.config.cjs
Normal file
36
jest.config.cjs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
module.exports = {
|
||||
preset: 'ts-jest/presets/default-esm',
|
||||
testEnvironment: 'node',
|
||||
|
||||
// Tell Jest where to look for source code and tests
|
||||
roots: ['<rootDir>/src', '<rootDir>/tests'],
|
||||
|
||||
// Explicitly match files in the tests folder
|
||||
testMatch: [
|
||||
'<rootDir>/tests/**/*.test.ts',
|
||||
'<rootDir>/tests/**/*.spec.ts'
|
||||
],
|
||||
|
||||
// Tell Jest to treat .ts files as ESM modules
|
||||
extensionsToTreatAsEsm: ['.ts'],
|
||||
|
||||
// Fixes the "Cannot find module" error
|
||||
moduleNameMapper: {
|
||||
// If the import starts with . or .. and ends with .js, strip the .js
|
||||
'^(\\.{1,2}/.*)\\.js$': '$1',
|
||||
|
||||
// Map the library to mock file
|
||||
// This tells Jest to load simple JS file instead of parsing the complex node_module
|
||||
//'^@BridgemanAccessible/ba-auth$': '<rootDir>/tests/__mocks__/ba-auth.js'
|
||||
},
|
||||
|
||||
// Configure the transformer to enable ESM support
|
||||
transform: {
|
||||
'^.+\\.tsx?$': [
|
||||
'ts-jest',
|
||||
{
|
||||
useESM: true,
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue