Skip to content

Commit 775fe02

Browse files
committed
style: resolve linter complaints
1 parent 1392a7c commit 775fe02

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import '../common/index.mjs';
12
import tmpdir from '../common/tmpdir.js';
23
import assert from 'node:assert/strict';
34
import { once } from 'node:events';
@@ -13,23 +14,23 @@ function convertScriptSourceToDataUrl(script) {
1314
return new URL(`data:text/javascript,${encodeURIComponent(script)}`);
1415
}
1516

16-
describe("Worker threads should not be able to access internal modules", () => {
17+
describe('Worker threads should not be able to access internal modules', () => {
1718
before(() => tmpdir.refresh());
1819

19-
test("worker instantiated with module file path", async () => {
20+
test('worker instantiated with module file path', async () => {
2021
const moduleFilepath = tmpdir.resolve('test-worker-internal-modules.mjs');
2122
await fs.writeFile(moduleFilepath, accessInternalsSource);
22-
const w = new Worker(moduleFilepath)
23-
await assert.rejects(once(w, "exit"))
24-
})
23+
const w = new Worker(moduleFilepath);
24+
await assert.rejects(once(w, 'exit'), { code: 'ERR_UNKNOWN_BUILTIN_MODULE' });
25+
});
2526

26-
test("worker instantiated with module source", async () => {
27-
const w = new Worker(accessInternalsSource, { eval: true })
28-
await assert.rejects(once(w, "exit"))
29-
})
27+
test('worker instantiated with module source', async () => {
28+
const w = new Worker(accessInternalsSource, { eval: true });
29+
await assert.rejects(once(w, 'exit'), { code: 'ERR_UNKNOWN_BUILTIN_MODULE' });
30+
});
3031

31-
test("worker instantiated with data: URL", async () => {
32-
const w = new Worker(convertScriptSourceToDataUrl(accessInternalsSource))
33-
await assert.rejects(once(w, "exit"))
34-
})
35-
})
32+
test('worker instantiated with data: URL', async () => {
33+
const w = new Worker(convertScriptSourceToDataUrl(accessInternalsSource));
34+
await assert.rejects(once(w, 'exit'), { code: 'ERR_UNKNOWN_BUILTIN_MODULE' });
35+
});
36+
});

0 commit comments

Comments
 (0)