MCPcopy Index your code
hub / github.com/bytecodealliance/ComponentizeJS / test

Function test

test/builtins/math-random-disabled.js:12–23  ·  view source on GitHub ↗
(run)

Source from the content-addressed store, hash-verified

10export const disableFeatures = ['random'];
11
12export async function test(run) {
13 const { stdout, stderr } = await run();
14 strictEqual(stderr, '');
15 const [num1, num2] = stdout.split('\n');
16 ok(Number(num1) > 0 && Number(num1) < 1);
17 ok(Number(num2) > 0 && Number(num2) < 1);
18 notStrictEqual(Number(num1), Number(num2));
19
20 // NOT random
21 strictEqual(Number(num1), 0.48401551228016615);
22 strictEqual(Number(num2), 0.866216232534498);
23}

Callers

nothing calls this directly

Calls 1

runFunction · 0.50

Tested by

no test coverage detected