diff --git a/src/routers/__tests__/StackRouter-test.js b/src/routers/__tests__/StackRouter-test.js index 1f2df02..b668fc2 100644 --- a/src/routers/__tests__/StackRouter-test.js +++ b/src/routers/__tests__/StackRouter-test.js @@ -869,6 +869,7 @@ describe('StackRouter', () => { }); test('Maps old actions (uses "Handles the reset action" test)', () => { + global.console.warn = jest.fn(); const router = StackRouter({ Foo: { screen: () =>
, @@ -895,5 +896,10 @@ describe('StackRouter', () => { expect(state2 && state2.routes[0].params).toEqual({ bar: '42' }); expect(state2 && state2.routes[0].routeName).toEqual('Foo'); expect(state2 && state2.routes[1].routeName).toEqual('Bar'); + expect(console.warn).toBeCalledWith( + expect.stringContaining( + "The action type 'Init' has been renamed to 'Navigation/INIT'" + ) + ); }); }); diff --git a/src/routers/__tests__/TabRouter-test.js b/src/routers/__tests__/TabRouter-test.js index 4fe24a2..cccb389 100644 --- a/src/routers/__tests__/TabRouter-test.js +++ b/src/routers/__tests__/TabRouter-test.js @@ -549,6 +549,7 @@ describe('TabRouter', () => { }); test('Maps old actions (uses "getStateForAction returns null when navigating to same tab" test)', () => { + global.console.warn = jest.fn(); const router = TabRouter( { Foo: BareLeafRouteConfig, Bar: BareLeafRouteConfig }, { initialRouteName: 'Bar' } @@ -561,6 +562,11 @@ describe('TabRouter', () => { state ); expect(state2).toEqual(null); + expect(console.warn).toBeCalledWith( + expect.stringContaining( + "The action type 'Init' has been renamed to 'Navigation/INIT'" + ) + ); }); test('Can navigate to other tab (no router) with params', () => {