| 1 | import { deepStrictEqual } from 'node:assert' |
| 2 | |
| 3 | export function test(instance) { |
| 4 | const { Thing } = instance.resourceWithLists |
| 5 | |
| 6 | let encoder = new TextEncoder() |
| 7 | |
| 8 | let thing1 = new Thing(encoder.encode("Hi")) |
| 9 | |
| 10 | deepStrictEqual(thing1.foo(), encoder.encode("Hi Thing HostThing HostThing.foo Thing.foo")) |
| 11 | |
| 12 | thing1.bar(encoder.encode("Hola")) |
| 13 | |
| 14 | deepStrictEqual(thing1.foo(), encoder.encode("Hola Thing.bar HostThing.bar HostThing.foo Thing.foo")) |
| 15 | |
| 16 | deepStrictEqual(Thing.baz(encoder.encode("Ohayo Gozaimas")), |
| 17 | encoder.encode("Ohayo Gozaimas Thing.baz HostThing.baz Thing.baz again")) |
| 18 | } |
| 19 | |