| 23 | });`; |
| 24 | |
| 25 | export 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 | |
| 50 | export async function assertBundlesTypeScriptTests() { |
| 51 | await fs.outputFile('./test/fixtures/a.spec.ts', passingSpec); |