mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 06:17:10 +01:00
Handle test reports with no test cases
This commit is contained in:
parent
a1cbedbccb
commit
a9749e3840
13 changed files with 114 additions and 18 deletions
|
|
@ -7,6 +7,22 @@ import {getReport} from '../src/report/get-report'
|
|||
import {normalizeFilePath} from '../src/utils/path-utils'
|
||||
|
||||
describe('dart-json tests', () => {
|
||||
it('produces empty test run result when there are no test cases', async () => {
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'empty', 'dart-json.json')
|
||||
const filePath = normalizeFilePath(path.relative(__dirname, fixturePath))
|
||||
const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'})
|
||||
|
||||
const opts: ParseOptions = {
|
||||
parseErrors: true,
|
||||
trackedFiles: []
|
||||
}
|
||||
|
||||
const parser = new DartJsonParser(opts, 'dart')
|
||||
const result = await parser.parse(filePath, fileContent)
|
||||
expect(result.tests).toBe(0)
|
||||
expect(result.result).toBe('success')
|
||||
})
|
||||
|
||||
it('matches report snapshot', async () => {
|
||||
const opts: ParseOptions = {
|
||||
parseErrors: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue