mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
Signed-off-by: Raul Garcia <rraulg5@gmail.com> PR-URL: https://github.com/nodejs/node/pull/67128 Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
19 lines
404 B
JavaScript
19 lines
404 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
const assert = require('assert');
|
|
|
|
// Test invalid `paths` entries: Ensure non-string entries throw an error
|
|
{
|
|
const paths = [1, false, null, undefined, () => { }, {}];
|
|
for (const path of paths) {
|
|
assert.throws(
|
|
() => require.resolve('.', { paths: [path] }),
|
|
{
|
|
name: 'TypeError',
|
|
code: 'ERR_INVALID_ARG_TYPE',
|
|
}
|
|
);
|
|
}
|
|
}
|