-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* enhance reporters * adding long run monitoring * fix eslint error
- Loading branch information
1 parent
18ce4c3
commit 6a6fe53
Showing
14 changed files
with
346 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
// Custom Jest reporter used by jest-vscode extension | ||
class VSCodeJestReporter { | ||
onRunStart() { | ||
// tslint:disable-next-line: no-console | ||
console.log('onRunStart'); | ||
|
||
import type { AggregatedResult } from '@jest/test-result'; | ||
import { Reporter, Context } from '@jest/reporters'; | ||
|
||
export default class VSCodeJestReporter implements Reporter { | ||
onRunStart(aggregatedResults: AggregatedResult): void { | ||
console.log(`onRunStart: numTotalTestSuites: ${aggregatedResults.numTotalTestSuites}`); | ||
} | ||
onRunComplete() { | ||
// tslint:disable-next-line: no-console | ||
console.log('onRunComplete'); | ||
|
||
onRunComplete(_contexts: Set<Context>, results: AggregatedResult): void { | ||
// report exec errors that could have prevented Result file being generated | ||
// TODO: replace with checking results.runExecError after Jest release https://github.com/facebook/jest/pull/13203 | ||
if (results.numTotalTests === 0 && results.numTotalTestSuites > 0) { | ||
console.log('onRunComplete: execError: no test is run'); | ||
} else { | ||
console.log('onRunComplete'); | ||
} | ||
} | ||
getLastError(): Error | undefined { | ||
return; | ||
} | ||
} | ||
|
||
module.exports = VSCodeJestReporter; |
Oops, something went wrong.