From a8052935cd4d767ee2f47abea434db393207885b Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Tue, 5 May 2020 00:14:28 +0200 Subject: [PATCH] chore: re-add deleted tests property to circus events --- packages/jest-circus/src/eventHandler.ts | 1 + packages/jest-circus/src/utils.ts | 1 + packages/jest-types/src/Circus.ts | 2 ++ 3 files changed, 4 insertions(+) diff --git a/packages/jest-circus/src/eventHandler.ts b/packages/jest-circus/src/eventHandler.ts index 590e66ca3a13..dfe916a629a1 100644 --- a/packages/jest-circus/src/eventHandler.ts +++ b/packages/jest-circus/src/eventHandler.ts @@ -148,6 +148,7 @@ const eventHandler: Circus.EventHandler = ( state.hasFocusedTests = true; } currentDescribeBlock.children.push(test); + currentDescribeBlock.tests.push(test); break; } case 'hook_failure': { diff --git a/packages/jest-circus/src/utils.ts b/packages/jest-circus/src/utils.ts index 2a5322607d17..ca9bebeef466 100644 --- a/packages/jest-circus/src/utils.ts +++ b/packages/jest-circus/src/utils.ts @@ -34,6 +34,7 @@ export const makeDescribe = ( mode: _mode, name: convertDescriptorToString(name), parent, + tests: [], }; }; diff --git a/packages/jest-types/src/Circus.ts b/packages/jest-types/src/Circus.ts index 963a6a61b537..c1ef85c79892 100644 --- a/packages/jest-types/src/Circus.ts +++ b/packages/jest-types/src/Circus.ts @@ -207,6 +207,8 @@ export type DescribeBlock = { mode: BlockMode; name: BlockName; parent?: DescribeBlock; + /** @deprecated Please get from `children` array instead */ + tests: Array; }; export type TestError = Exception | [Exception | undefined, Exception]; // the error from the test, as well as a backup error for async