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());