test: move shared module to `test/common` · nodejs/node@77761af · GitHub
Skip to content

Commit 77761af

Browse files
Trottmarco-ippolito
authored andcommitted
test: move shared module to test/common
`test/fixtures/process-exit-code-cases.js` is a shared module and should be in `test/common` (so it gets linted, etc.) and documented in `test/common/README.md`. PR-URL: #54042 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
1 parent e326342 commit 77761af

4 files changed

Lines changed: 42 additions & 20 deletions

File tree

test/common/README.md

Lines changed: 38 additions & 16 deletions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function getTestCases(isWorker = false) {
3636
function exitWithOneOnUncaught() {
3737
process.exitCode = 99;
3838
process.on('exit', (code) => {
39-
// cannot use assert because it will be uncaughtException -> 1 exit code
39+
// Cannot use assert because it will be uncaughtException -> 1 exit code
4040
// that will render this test useless
4141
if (code !== 1 || process.exitCode !== 1) {
4242
console.log('wrong code! expected 1 for uncaughtException');
@@ -113,7 +113,7 @@ function getTestCases(isWorker = false) {
113113

114114
function exitWithThrowInUncaughtHandler() {
115115
process.on('uncaughtException', () => {
116-
throw new Error('ok')
116+
throw new Error('ok');
117117
});
118118
throw new Error('bad');
119119
}

test/parallel/test-process-exit-code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require('../common');
2424
const assert = require('assert');
2525
const debug = require('util').debuglog('test');
2626

27-
const { getTestCases } = require('../fixtures/process-exit-code-cases');
27+
const { getTestCases } = require('../common/process-exit-code-cases');
2828
const testCases = getTestCases(false);
2929

3030
if (!process.argv[2]) {

test/parallel/test-worker-exit-code.js

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)