Skip to content

Commit 7f98196

Browse files
committed
fixup! fixup! fixup! [Squash] fixup
1 parent c921f3c commit 7f98196

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

test/test-resourcelimits.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Piscina from '..';
22
import { test } from 'tap';
33
import { resolve } from 'path';
44

5-
test('resourceLimits causes task to reject', async ({ is, match }) => {
5+
test('resourceLimits causes task to reject', async ({ is, rejects }) => {
66
const worker = new Piscina({
77
filename: resolve(__dirname, 'fixtures/resource-limits.js'),
88
resourceLimits: {
@@ -11,14 +11,13 @@ test('resourceLimits causes task to reject', async ({ is, match }) => {
1111
codeRangeSizeMb: 16
1212
}
1313
});
14+
worker.on('error', () => {
15+
// Ignore any additional errors
16+
});
1417
const limits : any = worker.options.resourceLimits;
1518
is(limits.maxOldGenerationSizeMb, 16);
1619
is(limits.maxYoungGenerationSizeMb, 4);
1720
is(limits.codeRangeSizeMb, 16);
18-
try {
19-
await worker.runTask(null);
20-
} catch (err) {
21-
match(err.message,
22-
/Worker terminated due to reaching memory limit: JS heap out of memory/);
23-
}
21+
rejects(worker.runTask(null),
22+
/Worker terminated due to reaching memory limit: JS heap out of memory/);
2423
});

0 commit comments

Comments
 (0)