mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
6317b8432e
PR-URL: https://github.com/nodejs/node/pull/43396 Fixes: https://github.com/nodejs/node/issues/42785 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
17 lines
438 B
JavaScript
17 lines
438 B
JavaScript
'use strict';
|
|
require('../common');
|
|
const assert = require('assert');
|
|
const { isBuiltin } = require('module');
|
|
|
|
// Includes modules in lib/ (even deprecated ones)
|
|
assert(isBuiltin('http'));
|
|
assert(isBuiltin('sys'));
|
|
assert(isBuiltin('node:fs'));
|
|
assert(isBuiltin('node:test'));
|
|
|
|
// Does not include internal modules
|
|
assert(!isBuiltin('internal/errors'));
|
|
assert(!isBuiltin('test'));
|
|
assert(!isBuiltin(''));
|
|
assert(!isBuiltin(undefined));
|