fix: apply module search paths restriction on worker and child process (#41118)

This commit is contained in:
Cheng Zhao 2024-01-26 17:29:04 +09:00 committed by GitHub
parent 6c9f9de40a
commit db2bf1a0d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 76 additions and 85 deletions

View file

@ -23,6 +23,12 @@ describe('node feature', () => {
const [msg] = await message;
expect(msg).to.equal('message');
});
it('Has its module searth paths restricted', async () => {
const child = childProcess.fork(path.join(fixtures, 'module', 'module-paths.js'));
const [msg] = await once(child, 'message');
expect(msg.length).to.equal(2);
});
});
});