diff --git a/packages/jest-cli/src/__tests__/__snapshots__/notify_reporter.test.js.snap b/packages/jest-cli/src/__tests__/__snapshots__/notify_reporter.test.js.snap index 1ef4981233b5..30a010dcd5ef 100644 --- a/packages/jest-cli/src/__tests__/__snapshots__/notify_reporter.test.js.snap +++ b/packages/jest-cli/src/__tests__/__snapshots__/notify_reporter.test.js.snap @@ -3,32 +3,26 @@ exports[`test always 1`] = ` Array [ Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, Object { - "icon": true, "message": "3 of 3 tests failed", "title": "100% Failed", }, Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, Object { - "icon": true, "message": "3 of 3 tests failed", "title": "100% Failed", }, Object { - "icon": true, "message": "3 of 3 tests failed", "title": "100% Failed", }, @@ -38,22 +32,18 @@ Array [ exports[`test change 1`] = ` Array [ Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, Object { - "icon": true, "message": "3 of 3 tests failed", "title": "100% Failed", }, Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, Object { - "icon": true, "message": "3 of 3 tests failed", "title": "100% Failed", }, @@ -63,27 +53,22 @@ Array [ exports[`test failure-change 1`] = ` Array [ Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, Object { - "icon": true, "message": "3 of 3 tests failed", "title": "100% Failed", }, Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, Object { - "icon": true, "message": "3 of 3 tests failed", "title": "100% Failed", }, Object { - "icon": true, "message": "3 of 3 tests failed", "title": "100% Failed", }, @@ -93,17 +78,14 @@ Array [ exports[`test success 1`] = ` Array [ Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, @@ -113,27 +95,22 @@ Array [ exports[`test success-change 1`] = ` Array [ Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, Object { - "icon": true, "message": "3 of 3 tests failed", "title": "100% Failed", }, Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, Object { - "icon": true, "message": "3 tests passed", "title": "100% Passed", }, Object { - "icon": true, "message": "3 of 3 tests failed", "title": "100% Failed", }, diff --git a/packages/jest-cli/src/__tests__/notify_reporter.test.js b/packages/jest-cli/src/__tests__/notify_reporter.test.js index 576dead4bf8f..442815a197b4 100644 --- a/packages/jest-cli/src/__tests__/notify_reporter.test.js +++ b/packages/jest-cli/src/__tests__/notify_reporter.test.js @@ -13,8 +13,6 @@ import NotifyReporter from '../reporters/notify_reporter'; import type {TestSchedulerContext} from '../test_scheduler'; import type {AggregatedResult} from '../../../../types/TestResult'; -const ICON_PATH = '/assets/jest_logo.png'; - jest.mock('../reporters/default_reporter'); jest.mock('node-notifier', () => ({ notify: jest.fn(), @@ -57,8 +55,6 @@ const notifyEvents = [ aggregatedResultsFailure, ]; -const iconShown = path => path.endsWith(ICON_PATH); - test('.addReporter() .removeReporter()', () => { const scheduler = new TestScheduler( {}, @@ -74,7 +70,6 @@ test('.addReporter() .removeReporter()', () => { const testModes = (notifyMode: string, arl: Array) => { const notify = require('node-notifier'); - notify.notify.mock.calls = []; let previousContext = initialContext; arl.forEach((ar, i) => { @@ -92,8 +87,7 @@ const testModes = (notifyMode: string, arl: Array) => { }); expect( - notify.notify.mock.calls.map(([{icon, message, title}]) => ({ - icon: iconShown(icon), + notify.notify.mock.calls.map(([{message, title}]) => ({ message: message.replace('\u26D4\uFE0F ', '').replace('\u2705 ', ''), title, })), @@ -119,3 +113,7 @@ test('test success-change', () => { test('test failure-change', () => { testModes('failure-change', notifyEvents); }); + +afterEach(() => { + jest.clearAllMocks(); +});