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

Function testImports

test/cases/resources/source.js:40–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 return new Z(a.getA() + b.getA());
39 },
40 testImports () {
41 let y = new Y(3);
42 const sum1 = Y.add(y, 4).getA();
43 if (sum1 != 7) {
44 return { tag: 'err', value: `expected 7; got ${sum1}` };
45 }
46
47 y.setA(5);
48 const sum2 = Y.add(y, 4).getA();
49 if (sum2 != 9) {
50 return { tag: 'err', value: `expected 9; got ${sum2}` };
51 }
52
53 return { tag: 'ok' };
54 }
55};

Callers 1

testFunction · 0.70

Calls 3

setAMethod · 0.95
getAMethod · 0.45
addMethod · 0.45

Tested by 1

testFunction · 0.56