Skip to content

Commit 1935947

Browse files
committed
Rename result -> results to align with runCLI api
1 parent 0f8f6f2 commit 1935947

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

e2e/run-programmatically/core.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ const runConfig = Object.freeze({
1212
collectCoverage: false,
1313
watch: false,
1414
});
15-
const {result} = await jest.runCore(runConfig, configs);
16-
console.log(`runCore success, ${result.numPassedTests} passed tests.`);
15+
const {results} = await jest.runCore(runConfig, configs);
16+
console.log(`runCore success, ${results.numPassedTests} passed tests.`);

packages/jest-core/src/__tests__/runCore.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describe(runCore, () => {
4242
makeProjectConfig(),
4343
]);
4444
expect(jest.mocked(runJest)).toHaveBeenCalled();
45-
expect(actualResult).toEqual({result: {results: {success: true}}});
45+
expect(actualResult).toEqual({results: {results: {success: true}}});
4646
});
4747

4848
it('should provide stderr as output stream when useStderr is true', async () => {

packages/jest-core/src/runCore.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ const {print: preRunMessagePrint} = preRunMessage;
3535
* import {runCore, readConfigs} from 'jest';
3636
*
3737
* const {globalConfig, configs} = await readConfigs(process.argv, [process.cwd()]);
38-
* const results = await runCore(globalConfig, configs);
38+
* const {results} = await runCore(globalConfig, configs);
3939
* console.log(results);
4040
*/
4141
export async function runCore(
4242
globalConfig: Config.GlobalConfig,
4343
projectConfigs: Array<Config.ProjectConfig>,
4444
): Promise<RunCoreResult> {
4545
const outputStream = globalConfig.useStderr ? process.stderr : process.stdout;
46-
const result = await _run(globalConfig, projectConfigs, false, outputStream);
47-
return {result};
46+
const results = await _run(globalConfig, projectConfigs, false, outputStream);
47+
return {results};
4848
}
4949

5050
const buildContextsAndHasteMaps = async (

packages/jest-core/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ export type OnCompleteCallback = (
5151
* The result of running runCore.
5252
*/
5353
export type RunCoreResult = {
54-
result: AggregatedResult;
54+
results: AggregatedResult;
5555
};

0 commit comments

Comments
 (0)