84334a1f34
The int suite could not self-exit after the ESM fix (8e125799) unmasked 4
specs, and was patched with two things: forceExit:true AND a bounded
destroyTestDb (sql.end({ timeout: 5 })). The bounded teardown is the real
fix — postgres.js .end() without a timeout blocks indefinitely on a stuck
pooled connection (the CI-observed "Jest did not exit"); the { timeout: 5 }
grace drains then force-closes sockets so teardown always completes.
forceExit was redundant belt-and-suspenders that also HID whether the
process truly exits on its own. Removing it: every handle-creating spec is
verified to close its handle — ai-chat-stream closes its http.createServer
in a finally, public-share-workspace-limiter closes its ioredis via
redis.quit() in afterAll, and the shared DB pools close via the bounded
destroyTestDb. --detectOpenHandles is clean and the suite self-exits.
Kept: the bounded destroyTestDb (defense for a genuinely stuck connection).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
28 lines
990 B
JSON
28 lines
990 B
JSON
{
|
|
"moduleFileExtensions": ["js", "json", "ts", "tsx"],
|
|
"rootDir": "..",
|
|
"testRegex": ".*\\.int-spec\\.ts$",
|
|
"testPathIgnorePatterns": ["/node_modules/"],
|
|
"transform": {
|
|
"prosemirror-markdown/build/.+\\.js$": [
|
|
"babel-jest",
|
|
{ "presets": [["@babel/preset-env", { "targets": { "node": "current" } }]] }
|
|
],
|
|
"^.+\\.(t|j)sx?$": "ts-jest"
|
|
},
|
|
"transformIgnorePatterns": [
|
|
"/node_modules/(?!(\\.pnpm/)?(nanoid|uuid|image-dimensions|marked|happy-dom|lib0|@docmost/prosemirror-markdown)(@|/))"
|
|
],
|
|
"testEnvironment": "node",
|
|
"testTimeout": 60000,
|
|
"maxWorkers": 1,
|
|
"globalSetup": "<rootDir>/test/integration/global-setup.ts",
|
|
"globalTeardown": "<rootDir>/test/integration/global-teardown.ts",
|
|
"moduleNameMapper": {
|
|
"^@docmost/db/(.*)$": "<rootDir>/src/database/$1",
|
|
"^@docmost/transactional/(.*)$": "<rootDir>/src/integrations/transactional/$1",
|
|
"^@docmost/ee/(.*)$": "<rootDir>/src/ee/$1",
|
|
"^src/(.*)$": "<rootDir>/src/$1"
|
|
}
|
|
}
|