From 6cd5c7420ac82fe256180b29a1b8ab0b861cc1bc Mon Sep 17 00:00:00 2001 From: Kayla Altepeter Date: Fri, 12 Oct 2018 11:28:54 -0700 Subject: [PATCH] test: adding test coverage for SourceTextModule.evaluate This checks that invalid option throws an error. PR-URL: https://github.com/nodejs/node/pull/23595 Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater Reviewed-By: Anna Henningsen Reviewed-By: Tiancheng "Timothy" Gu --- test/parallel/test-vm-module-errors.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/parallel/test-vm-module-errors.js b/test/parallel/test-vm-module-errors.js index 6803e0d86b3ff4..a6b2a6e797a1bb 100644 --- a/test/parallel/test-vm-module-errors.js +++ b/test/parallel/test-vm-module-errors.js @@ -131,6 +131,15 @@ async function checkModuleState() { message: 'Module status must be one of instantiated, evaluated, and errored' }); + await expectsRejection(async () => { + const m = new SourceTextModule(''); + await m.evaluate(false); + }, { + code: 'ERR_INVALID_ARG_TYPE', + message: 'The "options" argument must be of type Object. ' + + 'Received type boolean' + }); + await expectsRejection(async () => { const m = await createEmptyLinkedModule(); await m.evaluate();