Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Fixes

- `[jest-circus]` Send test case results for `todo` tests ([#13915](https://github.com/facebook/jest/pull/13915))

### Chore & Maintenance

### Performance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ exports[`Custom Reporters Integration on jest-circus valid passing assertion cou
"onTestCaseResult: adds ok, status: passed, numExpectations: 3
onTestFileResult testCaseResult 0: adds ok, status: passed, numExpectations: 3"
`;

exports[`Custom Reporters Integration on jest-circus push test case results for todo tests 1`] = `
"onTestCaseResult: sample, status: todo, numExpectations: 0
onTestFileResult testCaseResult 0: sample, status: todo, numExpectations: 0"
`;
15 changes: 15 additions & 0 deletions e2e/__tests__/customReportersOnCircus.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,19 @@ describe('Custom Reporters Integration on jest-circus', () => {

expect(stdout).toMatchSnapshot();
});

test('push test case results for todo tests', () => {
const {stdout} = runJest('custom-reporters', [
'--config',
JSON.stringify({
reporters: [
'default',
'<rootDir>/reporters/AssertionCountsReporter.js',
],
}),
'todo.test.js',
]);

expect(stdout).toMatchSnapshot();
});
});
13 changes: 13 additions & 0 deletions e2e/custom-reporters/__tests__/todo.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/

'use strict';

describe('Custom Reporters', () => {
it.todo('sample');
});
1 change: 1 addition & 0 deletions packages/jest-circus/src/testCaseReportHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const testCaseReportHandler =
(testPath: string, sendMessageToJest: TestFileEvent) =>
(event: Circus.Event): void => {
switch (event.name) {
case 'test_todo':
case 'test_done': {
const testResult = makeSingleTestResult(event.test);
const testCaseResult = parseSingleTestResult(testResult);
Expand Down