mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-16 06:17:10 +01:00
Fix flutter-json doesn't provide error details
This commit is contained in:
parent
2365963b2e
commit
855ff9bfaf
13 changed files with 3196 additions and 51 deletions
|
|
@ -27,4 +27,27 @@ describe('dart-json tests', () => {
|
|||
fs.mkdirSync(path.dirname(outputPath), {recursive: true})
|
||||
fs.writeFileSync(outputPath, report)
|
||||
})
|
||||
|
||||
it('report from rrousselGit/provider test results matches snapshot', async () => {
|
||||
const fixturePath = path.join(__dirname, 'fixtures', 'external', 'flutter', 'provider-test-results.json')
|
||||
const trackedFilesPath = path.join(__dirname, 'fixtures', 'external', 'flutter', 'files.txt')
|
||||
const outputPath = path.join(__dirname, '__outputs__', 'provider-test-results.md')
|
||||
const filePath = normalizeFilePath(path.relative(__dirname, fixturePath))
|
||||
const fileContent = fs.readFileSync(fixturePath, {encoding: 'utf8'})
|
||||
|
||||
const trackedFiles = fs.readFileSync(trackedFilesPath, {encoding: 'utf8'}).split(/\n\r?/g)
|
||||
const opts: ParseOptions = {
|
||||
trackedFiles,
|
||||
parseErrors: true,
|
||||
workDir: '/__w/provider/provider/'
|
||||
}
|
||||
|
||||
const parser = new DartJsonParser(opts)
|
||||
const result = await parser.parse(filePath, fileContent)
|
||||
expect(result).toMatchSnapshot()
|
||||
|
||||
const report = getReport([result])
|
||||
fs.mkdirSync(path.dirname(outputPath), {recursive: true})
|
||||
fs.writeFileSync(outputPath, report)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue