Skip to content

Commit 300f3f4

Browse files
committed
test: add a comment to explain how unexpected warnings are treated
Refs: https://github.com/nodejs/node/pull/48191/files#r1265469445 Signed-off-by: Darshan Sen <raisinten@gmail.com>
1 parent b3aa6ab commit 300f3f4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/fixtures/sea.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ const createdRequire = createRequire(__filename);
55
// because we set NODE_TEST_DIR=/Users/iojs/node-tmp on Jenkins CI.
66
const { expectWarning, mustNotCall } = createdRequire(process.env.COMMON_DIRECTORY);
77

8+
// This additionally makes sure that no unexpected warnings are emitted.
89
if (createdRequire('./sea-config.json').disableExperimentalSEAWarning) {
910
process.on('warning', mustNotCall());
1011
} else {
1112
expectWarning('ExperimentalWarning',
1213
'Single executable application is an experimental feature and ' +
1314
'might change at any time');
15+
// Any unexpected warning would throw this error:
16+
// https://github.com/nodejs/node/blob/c301404105a7256b79a0b8c4522ce47af96dfa17/test/common/index.js#L697-L700.
1417
}
1518

1619
// Should be possible to require core modules that optionally require the
@@ -19,7 +22,7 @@ const { deepStrictEqual, strictEqual, throws } = require('assert');
1922
const { dirname } = require('node:path');
2023

2124
// Checks that the source filename is used in the error stack trace.
22-
strictEqual(new Error('lol').stack.split('\n')[1], ' at sea.js:22:13');
25+
strictEqual(new Error('lol').stack.split('\n')[1], ' at sea.js:25:13');
2326

2427
// Should be possible to require a core module that requires using the "node:"
2528
// scheme.

0 commit comments

Comments
 (0)