Skip to content

Commit

Permalink
chore: re-add deleted tests property to circus events
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed May 4, 2020
1 parent 3669a86 commit a805293
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/jest-circus/src/eventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ const eventHandler: Circus.EventHandler = (
state.hasFocusedTests = true;
}
currentDescribeBlock.children.push(test);
currentDescribeBlock.tests.push(test);
break;
}
case 'hook_failure': {
Expand Down
1 change: 1 addition & 0 deletions packages/jest-circus/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const makeDescribe = (
mode: _mode,
name: convertDescriptorToString(name),
parent,
tests: [],
};
};

Expand Down
2 changes: 2 additions & 0 deletions packages/jest-types/src/Circus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ export type DescribeBlock = {
mode: BlockMode;
name: BlockName;
parent?: DescribeBlock;
/** @deprecated Please get from `children` array instead */
tests: Array<TestEntry>;
};

export type TestError = Exception | [Exception | undefined, Exception]; // the error from the test, as well as a backup error for async
Expand Down

2 comments on commit a805293

@noomorph
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SimenB, thanks for mentioning back then! I never knew we were using that property, sorry for not reacting correctly in time. I'll make sure we remove .tests read access during this month.

@SimenB
Copy link
Member Author

@SimenB SimenB commented on a805293 May 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noomorph no problem, the refactor was supposed to be breaking because it changed execution order, not because it broke integrations 🙂 We'll try to document this better soonish, which will make suchbreakagess more obvious

Please sign in to comment.