mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
test: cover experimental stream iterator builtins
Verify that stream/iter and zlib/iter are hidden by default and exposed under both supported specifier forms when --experimental-stream-iter is enabled. Assisted-by: Codex Signed-off-by: sjungwon03 <sjungwon03@gmail.com> PR-URL: https://github.com/nodejs/node/pull/65964 Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
This commit is contained in:
1 parent
53d7592378
commit
7fe64727a2
1 file changed
+18
@@ -24,6 +24,24 @@ for (const [id, flag] of experimentalBuiltins) {
|
||||
], { status: 0 });
|
||||
}
|
||||
|
||||
const schemelessExperimentalBuiltins = [
|
||||
['stream/iter', '--experimental-stream-iter'],
|
||||
['zlib/iter', '--experimental-stream-iter'],
|
||||
];
|
||||
|
||||
for (const [id, flag] of schemelessExperimentalBuiltins) {
|
||||
const nodeBuiltin = `node:${id}`;
|
||||
|
||||
spawnSyncAndAssert(process.execPath, [
|
||||
'-e', `const assert = require('node:assert'); const { builtinModules } = require('node:module'); assert(!builtinModules.includes('${id}')); assert(!builtinModules.includes('${nodeBuiltin}')); assert.throws(() => require('${id}'), { code: 'MODULE_NOT_FOUND' }); assert.throws(() => require('${nodeBuiltin}'), { code: 'ERR_UNKNOWN_BUILTIN_MODULE' });`,
|
||||
], { status: 0 });
|
||||
|
||||
spawnSyncAndAssert(process.execPath, [
|
||||
flag,
|
||||
'-e', `const assert = require('node:assert'); const { builtinModules } = require('node:module'); assert(builtinModules.includes('${id}')); assert(!builtinModules.includes('${nodeBuiltin}')); require('${id}'); require('${nodeBuiltin}');`,
|
||||
], { status: 0 });
|
||||
}
|
||||
|
||||
// node:ffi is enabled by default in builds with FFI support and can be
|
||||
// disabled with --no-experimental-ffi.
|
||||
if (common.hasFFI) {
|
||||
|
||||
Reference in new issue
Block a user