Skip to content

Commit f47aaf1

Browse files
committed
chore: add test coverage for tracing flag
1 parent 806bf09 commit f47aaf1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/cli.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,21 @@ export async function cliTest (fixtures) {
5454
}
5555
});
5656

57+
test('Transpile with tracing', async () => {
58+
try {
59+
const name = 'flavorful';
60+
const { stderr } = await exec(jcoPath, 'transpile', `test/fixtures/components/${name}.component.wasm`, '--name', name, '--map', 'testwasi=./wasi.js', '--tracing', '--base64-cutoff=0', '-o', outDir);
61+
strictEqual(stderr, '');
62+
const source = await readFile(`${outDir}/${name}.js`, 'utf8');
63+
ok(source.includes('function toResultString('));
64+
ok(source.includes('console.trace(`[module="test:flavorful/test", function="f-list-in-record1"] call a'));
65+
ok(source.includes('console.trace(`[module="test:flavorful/test", function="list-of-variants"] return result=${toResultString(ret)}`);'));
66+
}
67+
finally {
68+
await cleanup();
69+
}
70+
});
71+
5772
test('Transpile to JS', async () => {
5873
try {
5974
const name = 'flavorful';

0 commit comments

Comments
 (0)