Skip to content

Commit

Permalink
fix: removed test logs and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sauravhiremath committed Jun 23, 2020
1 parent 0937cf3 commit 6aee98d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
5 changes: 4 additions & 1 deletion packages/jest-circus/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import dedent = require('dedent');
import StackUtils = require('stack-utils');
import prettyFormat = require('pretty-format');
import type {AssertionResult, Status} from '@jest/test-result';
import type {ParseTestResults} from '@jest/types/src/Circus';
import {ROOT_DESCRIBE_BLOCK_NAME, getState} from './state';

const stackUtils = new StackUtils({cwd: 'A path that does not exist'});
Expand Down Expand Up @@ -446,7 +447,9 @@ export const parseSingleTestResult = (
};
};

export const parseTestResults = (testResults: Array<Circus.TestResult>) => {
export const parseTestResults = (
testResults: Array<Circus.TestResult>,
): ParseTestResults => {
let numFailingTests = 0;
let numPassingTests = 0;
let numPendingTests = 0;
Expand Down
6 changes: 4 additions & 2 deletions packages/jest-core/src/TestScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export default class TestScheduler {
this._dispatcher.unregister(ReporterClass);
}

async scheduleTests(tests: Array<TestRunner.Test>, watcher: TestWatcher) {
async scheduleTests(
tests: Array<TestRunner.Test>,
watcher: TestWatcher,
): Promise<any> {
const onTestFileStart = this._dispatcher.onTestFileStart.bind(
this._dispatcher,
);
Expand Down Expand Up @@ -185,7 +188,6 @@ export default class TestScheduler {
showStatus: !runInBand,
});


const testRunners = Object.create(null);
const contextsByTestRunner = new WeakMap<TestRunner, Context>();
contexts.forEach(context => {
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-reporters/src/Status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export default class Status {
this._emit();
}

addTestCaseResult(test: Test, testCaseResult: TestCaseResult) {
addTestCaseResult(test: Test, testCaseResult: TestCaseResult): void {
this._currentTestCases.push({test, testCaseResult});
if (!this._showStatus) {
this._emit();
Expand All @@ -126,7 +126,7 @@ export default class Status {
}
}

testStarted(testPath: Config.Path, config: Config.ProjectConfig) {
testStarted(testPath: Config.Path, config: Config.ProjectConfig): void {
this._currentTests.add(testPath, config);
if (!this._showStatus) {
this._emit();
Expand Down
1 change: 0 additions & 1 deletion packages/jest-reporters/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export const getSummary = (
const valuesForCurrentTestCases = getValuesCurrentTestCases(
options ? options.currentTestCases : [],
);
// console.log(aggregatedQuickStats.numPassingTests);

const estimatedTime = (options && options.estimatedTime) || 0;
const snapshotResults = aggregatedResults.snapshot;
Expand Down
12 changes: 9 additions & 3 deletions packages/jest-types/src/Circus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import type * as Global from './Global';
import type {AssertionResult} from './TestResult';

type Process = NodeJS.Process;

Expand Down Expand Up @@ -226,7 +227,12 @@ export type TestEntry = {
duration?: number | null;
status?: TestStatus | null; // whether the test has been skipped or run already
timeout?: number;
// children: Array<DescribeBlock | TestEntry>; // Added to include property from DescribeBlock
// hooks: Array<Hook>; // Added to include property from DescribeBlock
// tests: Array<TestEntry>; // Added to include property from DescribeBlock
};

export type ParseTestResults = {
assertionResults: Array<AssertionResult>;
numFailingTests: number;
numPassingTests: number;
numPendingTests: number;
numTodoTests: number;
};
1 change: 0 additions & 1 deletion packages/jest-worker/src/Farm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export default class Farm {
method: string,
...args: Array<any>
): PromiseWithCustomMessage<unknown> {

const customMessageListeners: Set<OnCustomMessage> = new Set();

const addCustomMessageListener = (listener: OnCustomMessage) => {
Expand Down

0 comments on commit 6aee98d

Please sign in to comment.