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

Function test

test/builtins/now-disabled.js:15–29  ·  view source on GitHub ↗
(run)

Source from the content-addressed store, hash-verified

13export const disableFeatures = ['clocks'];
14
15export async function test(run) {
16 const curNow = Date.now();
17 const { stdout, stderr } = await run();
18 strictEqual(stderr, '');
19 const times = stdout.split('\n');
20
21 // verify now was taken at build time
22 // NOTE: While build time is expected to be within 15 seconds,
23 // we avoid ensuring a specific bound on build time due to the
24 // unreliability of combinations of CI systems and specific OSes
25 ok(Number(times[0]) < curNow);
26
27 // verify disabled time doesn't progress
28 strictEqual(times[1], times[0]);
29}

Callers

nothing calls this directly

Calls 1

runFunction · 0.50

Tested by

no test coverage detected