diff --git a/CHANGELOG.md b/CHANGELOG.md index 830993a75ed1..ecb32c916df7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - `[jest-mock]` [**BREAKING**] Refactor `Mocked*` utility types. `MaybeMockedDeep` and `MaybeMocked` became `Mocked` and `MockedShallow` respectively; only deep mocked variants of `MockedClass`, `MockedFunction` and `MockedObject` are exported ([#13123](https://github.com/facebook/jest/pull/13123), [#13124](https://github.com/facebook/jest/pull/13124)) - `[jest-mock]` [**BREAKING**] Change the default `jest.mocked` helper’s behavior to deep mocked ([#13125](https://github.com/facebook/jest/pull/13125)) - `[jest-snapshot]` [**BREAKING**] Let `babel` find config when updating inline snapshots ([#13150](https://github.com/facebook/jest/pull/13150)) +- `[@jest/test-result, @jest/types]` [**BREAKING**] Replace `Bytes` and `Milliseconds` types with `number` ([#13155](https://github.com/facebook/jest/pull/13155)) - `[jest-worker]` Adds `workerIdleMemoryLimit` option which is used as a check for worker memory leaks >= Node 16.11.0 and recycles child workers as required ([#13056](https://github.com/facebook/jest/pull/13056), [#13105](https://github.com/facebook/jest/pull/13105), [#13106](https://github.com/facebook/jest/pull/13106), [#13107](https://github.com/facebook/jest/pull/13107)) - `[pretty-format]` [**BREAKING**] Remove `ConvertAnsi` plugin in favour of `jest-serializer-ansi-escapes` ([#13040](https://github.com/facebook/jest/pull/13040)) diff --git a/packages/jest-jasmine2/src/jasmine/Spec.ts b/packages/jest-jasmine2/src/jasmine/Spec.ts index 9300c3fe416c..55bb3a7f90fd 100644 --- a/packages/jest-jasmine2/src/jasmine/Spec.ts +++ b/packages/jest-jasmine2/src/jasmine/Spec.ts @@ -31,7 +31,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* eslint-disable sort-keys, local/prefer-spread-eventually, local/prefer-rest-params-eventually, @typescript-eslint/no-empty-function */ import {AssertionError} from 'assert'; -import type {FailedAssertion, Milliseconds, Status} from '@jest/test-result'; +import type {FailedAssertion, Status} from '@jest/test-result'; import type {Circus} from '@jest/types'; import {convertDescriptorToString} from 'jest-util'; import ExpectationFailed from '../ExpectationFailed'; @@ -63,7 +63,7 @@ export type SpecResult = { id: string; description: string; fullName: string; - duration?: Milliseconds; + duration?: number; failedExpectations: Array; testPath: string; passedExpectations: Array>; diff --git a/packages/jest-test-result/src/index.ts b/packages/jest-test-result/src/index.ts index 0ffa340c2c03..13f1db6c30cf 100644 --- a/packages/jest-test-result/src/index.ts +++ b/packages/jest-test-result/src/index.ts @@ -18,7 +18,6 @@ export type { AssertionResult, FailedAssertion, FormattedTestResults, - Milliseconds, RuntimeTransformResult, SerializableError, SnapshotSummary, diff --git a/packages/jest-test-result/src/types.ts b/packages/jest-test-result/src/types.ts index 2494a47f7c65..ff112858f8a1 100644 --- a/packages/jest-test-result/src/types.ts +++ b/packages/jest-test-result/src/types.ts @@ -42,10 +42,6 @@ export type AssertionLocation = { export type Status = AssertionResult['status']; -export type Bytes = number; - -export type Milliseconds = TestResult.Milliseconds; - export type AssertionResult = TestResult.AssertionResult; export type FormattedAssertionResult = Pick< @@ -96,17 +92,17 @@ export type TestResult = { displayName?: Config.DisplayName; failureMessage?: string | null; leaks: boolean; - memoryUsage?: Bytes; + memoryUsage?: number; numFailingTests: number; numPassingTests: number; numPendingTests: number; numTodoTests: number; openHandles: Array; perfStats: { - end: Milliseconds; - runtime: Milliseconds; + end: number; + runtime: number; slow: boolean; - start: Milliseconds; + start: number; }; skipped: boolean; snapshot: { diff --git a/packages/jest-types/src/TestResult.ts b/packages/jest-types/src/TestResult.ts index ab8135420bcb..57981fe9800c 100644 --- a/packages/jest-types/src/TestResult.ts +++ b/packages/jest-types/src/TestResult.ts @@ -5,8 +5,6 @@ * LICENSE file in the root directory of this source tree. */ -export type Milliseconds = number; - type Status = 'passed' | 'failed' | 'skipped' | 'pending' | 'todo' | 'disabled'; type Callsite = { @@ -17,7 +15,7 @@ type Callsite = { // this is here to make it possible to avoid huge dependency trees just for types export type AssertionResult = { ancestorTitles: Array; - duration?: Milliseconds | null; + duration?: number | null; failureDetails: Array; failureMessages: Array; fullName: string;