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