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

Function test

test/cases/resources/test.js:3–17  ·  view source on GitHub ↗
(instance)

Source from the content-addressed store, hash-verified

1import { strictEqual } from 'node:assert';
2
3export function test (instance) {
4 const { X, Z, add, testImports } = instance.exports;
5 const one = new Z(1);
6 const two = new Z(2);
7 strictEqual(add(one, two).getA(), 3);
8
9 let x = new X(3);
10 strictEqual(X.add(x, 4).getA(), 7);
11
12 let x2 = new X(3);
13 x2.setA(5);
14 strictEqual(X.add(x2, 4).getA(), 9);
15
16 strictEqual(testImports(), undefined);
17}

Callers

nothing calls this directly

Calls 5

setAMethod · 0.95
addFunction · 0.70
testImportsFunction · 0.70
getAMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected