- add jest, ts-jest, supertest, and related dev dependencies - add test scripts (test, test:debug, test:watch) to package.json - add jest.config.js with ts-jest transform and module name mappers - add controller specs for auth, browser, environment, mcp, scenario, session - add mocks for jsdom, playwright, and readability - add test/tsconfig.json and exclude test dir from main tsconfig
16 lines
485 B
JavaScript
16 lines
485 B
JavaScript
/** @type {import('jest').Config} */
|
|
module.exports = {
|
|
moduleFileExtensions: ['js', 'json', 'ts'],
|
|
rootDir: '.',
|
|
testRegex: 'test/.*\\.spec\\.ts$',
|
|
transform: {
|
|
'^.+\\.ts$': ['ts-jest', { tsconfig: 'test/tsconfig.json' }],
|
|
},
|
|
moduleNameMapper: {
|
|
'^jsdom$': '<rootDir>/test/__mocks__/jsdom.ts',
|
|
'^playwright$': '<rootDir>/test/__mocks__/playwright.ts',
|
|
'^@mozilla/readability$': '<rootDir>/test/__mocks__/readability.ts',
|
|
},
|
|
testEnvironment: 'node',
|
|
};
|