tests: Fix handling of nullish module definitions

pull/5256/head
Richard Hansen 2021-10-27 16:12:35 -04:00
parent 9987834b15
commit c8e544ec8d
1 changed files with 1 additions and 1 deletions

View File

@ -214,7 +214,7 @@ $(() => (async () => {
const [origDefs] = args;
const defs = {};
for (const [path, origDef] of Object.entries(origDefs)) {
defs[path] = function (require, exports, module) {
defs[path] = origDef == null ? origDef : function (require, exports, module) {
const calls = [];
mochaCalls.set(module.id.replace(/\.js$/, ''), calls);
// Backup Mocha functions. Note that because modules can require other modules, these