Skip to content

Commit

Permalink
add tests for test within src
Browse files Browse the repository at this point in the history
Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Dec 16, 2023
1 parent b2c3d77 commit 97b9fa0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/basic.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,27 @@ test('no files', async (t) => {

await completed
})

test('src-to-dist', async (t) => {
const { strictEqual, completed, match } = tspl(t, { plan: 4 })
const config = {
files: [],
cwd: join(import.meta.url, '..', 'fixtures', 'src-to-dist')
}

const stream = await runWithTypeScript(config)

const names = new Set(['add', 'add2'])

stream.once('data', (test) => {
strictEqual(test.type, 'test:diagnostic')
match(test.data.message, /TypeScript compilation complete \(\d+ms\)/)
})

stream.on('test:pass', (test) => {
strictEqual(names.has(test.name), true)
names.delete(test.name)
})

await completed
})

0 comments on commit 97b9fa0

Please sign in to comment.