diff --git a/package-lock.json b/package-lock.json index 1d82a8b..c9a583d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@biomejs/biome": "^1.9.4", "@ianvs/prettier-plugin-sort-imports": "^4.7.0", "@types/node": "^25.3.3", - "poku": "^4.1.0", + "poku": "^4.2.0", "prettier": "^3.8.1", "tsx": "^4.21.0", "typescript": "^5.9.3" @@ -25,7 +25,7 @@ }, "funding": { "type": "github", - "url": "https://github.com/pokujs/multi-suite?sponsor=1" + "url": "https://github.com/sponsors/wellwelwel" }, "peerDependencies": { "poku": "^4.1.0" @@ -982,9 +982,9 @@ "license": "ISC" }, "node_modules/poku": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/poku/-/poku-4.1.0.tgz", - "integrity": "sha512-gHyR0sE1zZ7qDowChiToZjQ75Dwqf0JDA3cHh5hVD8K00HOnVW4nr9XlximThE/AyenlxVatSEuiLfwYFcJS7w==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/poku/-/poku-4.2.0.tgz", + "integrity": "sha512-GygMGFGgEJ9kfs6Z+QPg/ODs9OF3oGHN8+hYIxtBox3pwYISO+Vu660vH1e+YzjpGoaoy2o5y6YwE1tX5yZx3Q==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index a3b4dae..6369e26 100644 --- a/package.json +++ b/package.json @@ -40,13 +40,13 @@ "@biomejs/biome": "^1.9.4", "@ianvs/prettier-plugin-sort-imports": "^4.7.0", "@types/node": "^25.3.3", - "poku": "^4.1.0", + "poku": "^4.2.0", "prettier": "^3.8.1", "tsx": "^4.21.0", "typescript": "^5.9.3" }, "peerDependencies": { - "poku": "^4.1.0" + "poku": "^4.2.0" }, "publishConfig": { "access": "public" diff --git a/src/index.ts b/src/index.ts index 5c88a32..eec6652 100644 --- a/src/index.ts +++ b/src/index.ts @@ -84,6 +84,6 @@ export const multiSuite = (suites: ConfigFile[]): PokuPlugin => ({ } process.removeListener('SIGINT', onSignal); - process.exit(finalCode); + process.exitCode = finalCode; }, }); diff --git a/test/integration/multi-suite.test.ts b/test/integration/multi-suite.test.ts index df31440..6476850 100644 --- a/test/integration/multi-suite.test.ts +++ b/test/integration/multi-suite.test.ts @@ -7,24 +7,17 @@ const OUTER_DIR = 'test/__fixtures__/empty'; const runPlugin = async ( suites: Parameters[0] ): Promise => { - const originalExit = process.exit; - let exitCode = 0; - - (process as NodeJS.Process).exit = ((code?: number) => { - exitCode = code === 0 ? 0 : 1; - }) as typeof process.exit; - - try { - await poku(OUTER_DIR, { - noExit: true, - quiet: true, - plugins: [multiSuite(suites)], - }); - } finally { - process.exit = originalExit; - } - - return exitCode; + const originalExitCode = process.exitCode; + + await poku(OUTER_DIR, { + noExit: true, + quiet: true, + plugins: [multiSuite(suites)], + }); + + const code = Number(process.exitCode ?? 0); + process.exitCode = originalExitCode; + return code; }; describe('Plugin: multi-suite', async () => {