Skip to content

Commit

Permalink
added test fs
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcanaltin committed Feb 9, 2023
1 parent 8ff55b8 commit 57f4e00
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/parallel/test-require-package-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ try {
error.requireStack = originalRequireStack;
}
console.error(error);
}
}

fs.writeFileSync(path.join(tmpdir.path, 'index.js'), 'require("a");');
fs.mkdirSync(path.join(tmpdir.path, 'node_modules'));
fs.mkdirSync(path.join(tmpdir.path, 'node_modules/a'));
fs.mkdirSync(path.join(tmpdir.path, 'node_modules/b'));
fs.writeFileSync(path.join(tmpdir.path, 'node_modules/a/a.js'), 'require("b");');
fs.writeFileSync(path.join(tmpdir.path, 'node_modules/a/package.json'), '{ "main": "a.js" }');
fs.writeFileSync(path.join(tmpdir.path, 'node_modules/b/package.json'), '{ "main": "b.js" }');

0 comments on commit 57f4e00

Please sign in to comment.