From ec4d79e25931f83dec91b8ca27ec9652d4ef3021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Arboleda?= Date: Tue, 12 Jan 2021 11:48:40 -0500 Subject: [PATCH] test: improve coverage at `lib/internal/vm/module.js` PR-URL: https://github.com/nodejs/node/pull/36898 Reviewed-By: James M Snell Reviewed-By: Antoine du Hamel Reviewed-By: Luigi Pinca Reviewed-By: Michael Dawson --- test/parallel/test-vm-module-synthetic.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/parallel/test-vm-module-synthetic.js b/test/parallel/test-vm-module-synthetic.js index 660c0c64ed8d5d..9d1c07ead5c4cd 100644 --- a/test/parallel/test-vm-module-synthetic.js +++ b/test/parallel/test-vm-module-synthetic.js @@ -65,4 +65,14 @@ const assert = require('assert'); code: 'ERR_VM_MODULE_STATUS', }); } + + { + assert.throws(() => { + SyntheticModule.prototype.setExport.call({}, 'foo'); + }, { + code: 'ERR_VM_MODULE_NOT_MODULE', + message: /Provided module is not an instance of Module/ + }); + } + })().then(common.mustCall());