Some checks failed
NYX Security Scan / nyx-scan (pull_request) Failing after 5m55s
The dependency bumps on main left `npm test` and `npm run build:types`
broken independently of any feature work; both fail on a clean checkout
of origin/main.
TypeScript 6 no longer auto-includes @types packages the way node10
resolution did, so every test suite failed to compile with "Cannot find
name 'describe'/'expect'". Declare the needed @types explicitly instead:
- tsconfig.json: types: ["node"]
- jest.config.js: types: ["jest", "node"]
TypeScript 6 also errors on two settings this config relied on:
- moduleResolution "node" (node10) is deprecated -> "bundler", which
matches how the package is actually consumed (rollup-bundled, with
"module": "ESNext")
- an implicit rootDir is now an error when outDir/declarationDir are
set -> rootDir: "./src"
Drop three unused imports that noUnusedLocals turns into hard errors,
failing --emitDeclarationOnly.
Finally, NodeSecureMemory logged to stdout unconditionally on
construction. This was dormant while the native addon failed to load;
once it loads, it broke the "no console.log when debug=false" test. A
library must not write to stdout uninvited, and the client already
reports this via getProtectionInfo() behind its own debug flag.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
27 lines
935 B
JavaScript
27 lines
935 B
JavaScript
/** @type {import('jest').Config} */
|
|
module.exports = {
|
|
preset: 'ts-jest',
|
|
testEnvironment: 'node',
|
|
testMatch: ['**/tests/unit/**/*.test.ts', '**/tests/integration/**/*.test.ts'],
|
|
transform: {
|
|
'^.+\\.tsx?$': ['ts-jest', {
|
|
tsconfig: {
|
|
// Reuse main tsconfig but include tests and relax for test env
|
|
target: 'ES2020',
|
|
module: 'commonjs',
|
|
lib: ['ES2020', 'DOM'],
|
|
strict: true,
|
|
esModuleInterop: true,
|
|
skipLibCheck: true,
|
|
moduleResolution: 'node',
|
|
resolveJsonModule: true,
|
|
types: ['jest', 'node'],
|
|
allowSyntheticDefaultImports: true,
|
|
// Relax unused-var rules in tests
|
|
noUnusedLocals: false,
|
|
noUnusedParameters: false,
|
|
},
|
|
}],
|
|
},
|
|
testTimeout: 60000,
|
|
};
|