Offload functions to worker threads with shared memory primitives for Node.js.
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: move mo() call out of assign test into fixture

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+4 -5
+4 -5
test/assign.test.ts
··· 1 1 import { describe, it } from 'node:test'; 2 2 import assert from 'node:assert/strict'; 3 - import { mo, workers, assign } from 'moroutine'; 4 - 5 - const double = mo(import.meta, (n: number): number => n * 2); 3 + import { workers, assign } from 'moroutine'; 4 + import { identity } from './fixtures/worker-handle.ts'; 6 5 7 6 describe('assign()', () => { 8 7 it('returns a new task with worker set', () => { 9 8 const run = workers(1); 10 9 try { 11 - const task = double(5); 10 + const task = identity(5); 12 11 const assigned = assign(run.workers[0], task); 13 12 assert.notStrictEqual(assigned, task); 14 13 assert.equal(assigned.id, task.id); ··· 23 22 it('does not modify the original task', () => { 24 23 const run = workers(1); 25 24 try { 26 - const task = double(5); 25 + const task = identity(5); 27 26 assign(run.workers[0], task); 28 27 assert.equal(task.worker, undefined); 29 28 } finally {