Offload functions to worker threads with shared memory primitives for Node.js.
1import { describe, it } from 'node:test';
2import assert from 'node:assert/strict';
3import { double, lateRegistration } from './fixtures/freeze.ts';
4
5describe('module freezing', () => {
6 it('throws when mo() is called after a task from that module has been dispatched', async () => {
7 await double(2);
8 assert.throws(lateRegistration, {
9 message: /Cannot call mo\(\).*after a task from this module has been dispatched/,
10 });
11 });
12});