-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathjest.security.config.js
36 lines (33 loc) · 1.1 KB
/
jest.security.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
export default {
testMatch: ['<rootDir>/tests/security/**/*.test.ts'],
setupFilesAfterEnv: ['./jest.setup.js'],
testEnvironment: 'node',
verbose: true,
coveragePathIgnorePatterns: [
'/node_modules/',
'/dist/',
'/tests/'
],
testTimeout: 30000,
extensionsToTreatAsEsm: ['.ts', '.mts'],
moduleFileExtensions: ['ts', 'mts', 'js', 'mjs', 'cjs', 'jsx', 'tsx', 'json', 'node'],
transform: {
'^.+\\.(t|j)sx?$': ['ts-jest', {
useESM: true,
isolatedModules: true,
tsconfig: 'tsconfig.json'
}]
},
moduleNameMapper: {
// Handle path extensions for ESM
'^(\\.{1,2}/.*)\\.js$': '$1',
'^(\\.{1,2}/.*)\\.ts$': '$1',
// Map specific Solana packages to their ESM versions
'^@solana/web3.js$': '<rootDir>/node_modules/@solana/web3.js/lib/index.esm.js',
'^@solana/spl-token$': '<rootDir>/node_modules/@solana/spl-token/lib/index.esm.js',
// Handle remaining @solana packages
'^@solana/(.*)$': '<rootDir>/node_modules/@solana/$1/lib/esm/index.js',
// Handle other module imports
'^@tensorflow/(.*)$': '<rootDir>/node_modules/@tensorflow/$1'
}
};