Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = module.prefetch("./b").then(function (id) {
assert.strictEqual(id, "/b.js");
assert.strictEqual(require("./b").name, id);
assert.strictEqual(require("./c").name, "/c.js");
assert.strictEqual(
require("d").name,
"/node_modules/d/index.js"
);
assert.strictEqual(
require("d/package").name,
"/node_modules/d/package.json"
);
return module.prefetch("./nonexistent").catch(function (error) {
assert.ok(error instanceof Error);
assert.ok(error.message.startsWith("Cannot find module"));
});
});
},