Skip to content

Commit

Permalink
Rename method and add CHANGELOG
Browse files Browse the repository at this point in the history
Co-Authored-By: Simen Bekkhus <sbekkhus91@gmail.com>
  • Loading branch information
Mark1626 and SimenB committed Aug 22, 2019
1 parent c9e2117 commit 270f5e4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- `[babel-plugin-jest-hoist]` Show codeframe on static hoisting issues ([#8865](https://github.com/facebook/jest/pull/8865))
- `[jest-config]` [**BREAKING**] Set default display name color based on runner ([#8689](https://github.com/facebook/jest/pull/8689))
- `[@jest/test-result]` Create method to create empty `TestResult` ([#8867](https://github.com/facebook/jest/pull/8867))

### Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
AssertionResult,
Status,
TestResult,
emptyTestResult,
createEmptyTestResult,
} from '@jest/test-result';
import {extractExpectedAssertionsErrors, getState, setState} from 'expect';
import {formatExecError, formatResultsErrors} from 'jest-message-util';
Expand Down Expand Up @@ -220,7 +220,7 @@ export const runAndTransformResultsToJestFormat = async ({

dispatch({name: 'teardown'});
return {
...emptyTestResult(),
...createEmptyTestResult(),
console: undefined,
displayName: config.displayName,
failureMessage,
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-jasmine2/src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import {Config} from '@jest/types';
import {AssertionResult, TestResult, emptyTestResult} from '@jest/test-result';
import {AssertionResult, TestResult, createEmptyTestResult} from '@jest/test-result';
import {formatResultsErrors} from 'jest-message-util';
import {SpecResult} from './jasmine/Spec';
import {SuiteResult} from './jasmine/Suite';
Expand Down Expand Up @@ -78,7 +78,7 @@ export default class Jasmine2Reporter implements Reporter {
});

const testResult = {
...emptyTestResult(),
...createEmptyTestResult(),
console: null,
failureMessage: formatResultsErrors(
testResults,
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-test-result/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const addResult = (
testResult.snapshot.updated;
};

export const emptyTestResult = (): TestResult => ({
export const createEmptyTestResult = (): TestResult => ({
leaks: false, // That's legacy code, just adding it so Flow is happy.
numFailingTests: 0,
numPassingTests: 0,
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-test-result/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export {default as formatTestResults} from './formatTestResults';
export {
addResult,
buildFailureTestResult,
emptyTestResult,
createEmptyTestResult,
makeEmptyAggregatedTestResult,
} from './helpers';
export {
Expand Down

0 comments on commit 270f5e4

Please sign in to comment.