1
0
Fork 0
mirror of https://github.com/dorny/test-reporter.git synced 2026-02-04 05:27:55 +01:00

Update TypeScript

This commit is contained in:
Michal Dorner 2022-08-19 22:19:29 +02:00
parent 8848447e3f
commit 4c7348c4be
No known key found for this signature in database
GPG key ID: 7325B8B59CA1B65C
4 changed files with 12 additions and 4585 deletions

4589
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -60,7 +60,7 @@
"js-yaml": "^4.0.0", "js-yaml": "^4.0.0",
"prettier": "2.2.1", "prettier": "2.2.1",
"ts-jest": "^26.5.3", "ts-jest": "^26.5.3",
"typescript": "^4.2.3" "typescript": "^4.7.4"
}, },
"jest-junit": { "jest-junit": {
"suiteName": "jest tests", "suiteName": "jest tests",

View file

@ -25,7 +25,8 @@ async function main(): Promise<void> {
const testReporter = new TestReporter() const testReporter = new TestReporter()
await testReporter.run() await testReporter.run()
} catch (error) { } catch (error) {
core.setFailed(error.message) if (error instanceof Error) core.setFailed(error)
else core.setFailed(JSON.stringify(error))
} }
} }

View file

@ -92,7 +92,8 @@ export class DartJsonParser implements TestParser {
try { try {
return JSON.parse(str) return JSON.parse(str)
} catch (e) { } catch (e) {
const col = e.columnNumber !== undefined ? `:${e.columnNumber}` : '' const errWithCol = e as {columnNumber?: number}
const col = errWithCol.columnNumber !== undefined ? `:${errWithCol.columnNumber}` : ''
throw new Error(`Invalid JSON at ${path}:${i + 1}${col}\n\n${e}`) throw new Error(`Invalid JSON at ${path}:${i + 1}${col}\n\n${e}`)
} }
}) })