MCPcopy Create free account
hub / github.com/cfworker/cfworker / assertBundlesJavaScriptTests

Function assertBundlesJavaScriptTests

packages/dev/test/test-command.spec.js:25–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23});`;
24
25export async function assertBundlesJavaScriptTests() {
26 await fs.outputFile('./test/fixtures/a.spec.js', passingSpec);
27 await fs.outputFile('./test/fixtures/b.spec.js', failingSpec);
28 const command = new TestCommand({
29 globs: ['test/fixtures/*.spec.js'],
30 port,
31 inspect: false,
32 watch: true,
33 check: true,
34 kv: []
35 });
36
37 let testEnd = new Promise(resolve =>
38 command.testHost.on('test-end', resolve)
39 );
40 command.execute();
41 assert.equal(await testEnd, 1);
42
43 testEnd = new Promise(resolve => command.testHost.on('test-end', resolve));
44 await fs.outputFile('./test/fixtures/b.spec.js', passingSpec);
45 assert.equal(await testEnd, 0);
46
47 command.dispose();
48}
49
50export async function assertBundlesTypeScriptTests() {
51 await fs.outputFile('./test/fixtures/a.spec.ts', passingSpec);

Callers

nothing calls this directly

Calls 3

executeMethod · 0.95
disposeMethod · 0.95
onMethod · 0.80

Tested by

no test coverage detected