test: add url type check in Module options

The code coverage in `root/internal/vm/Module.js` lacked test coverage
for the url options paramter. The test adds a check to ensure error
is thrown.

PR-URL: https://github.com/nodejs/node/pull/18664
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
JiaHerr Tee 2018-02-08 18:38:38 -05:00 committed by Gus Caplan
parent 523a1550a3
commit edffad075e

View File

@ -44,7 +44,7 @@ async function checkArgType() {
});
for (const invalidOptions of [
0, 1, null, true, 'str', () => {}, Symbol.iterator
0, 1, null, true, 'str', () => {}, { url: 0 }, Symbol.iterator
]) {
common.expectsError(() => {
new Module('', invalidOptions);