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 { uint32 } from 'moroutine';
4
5describe('Uint32', () => {
6 it('self-allocates and initializes to zero', () => {
7 const v = uint32();
8 assert.equal(v.load(), 0);
9 });
10
11 it('stores and loads a value', () => {
12 const v = uint32();
13 v.store(42);
14 assert.equal(v.load(), 42);
15 });
16
17 it('exposes byteSize of 4', () => {
18 assert.equal(uint32.byteSize, 4);
19 });
20
21 it('exposes byteAlignment of 4', () => {
22 assert.equal(uint32.byteAlignment, 4);
23 });
24});