test: improve coverage at lib/internal/vm/module.js

PR-URL: https://github.com/nodejs/node/pull/36898
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
This commit is contained in:
Juan José Arboleda authored and Antoine du Hamel committed 2021-01-18 11:47:47 +01:00
1 parent 5716130d1e
commit 146f0fc495
1 file changed
+10
+10
View File
@@ -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());