mirror of
https://github.com/status-im/react-navigation.git
synced 2025-02-25 01:28:16 +00:00
Trivial: cleanup warnings in test suite (#2581)
* Mock and verify console warnings to prevent noise in the test output. * Tighten up expectations on deprecation output. * 80 column formatting. * Actually fix formatting.
This commit is contained in:
parent
ee2e27c24b
commit
b7768d12e6
@ -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: () => <div />,
|
||||
@ -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'"
|
||||
)
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -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', () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user