From 3ac4749d7c0dde18b6210708e346f334e2a0e371 Mon Sep 17 00:00:00 2001 From: Pablo Grass Date: Thu, 20 Dec 2018 12:02:58 +0100 Subject: [PATCH] tests: ensure init.spec mocks used getUrl method Previously, the used method was not mocked which caused the test to result in an unhandled promise - and as this was only a warning it stayed green. Bug: T212409 --- tests/unit/client/init.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit/client/init.spec.ts b/tests/unit/client/init.spec.ts index db2856b..c329d4f 100644 --- a/tests/unit/client/init.spec.ts +++ b/tests/unit/client/init.spec.ts @@ -18,7 +18,11 @@ function mockMwEnv( language: string, entityId: any, namespaces: any = null, tit } } }, hook: () => new ImmediatelyInvokingEntityLoadedHookHandler( {} ), - Title: title || jest.fn().mockImplementation(), + Title: title || jest.fn().mockImplementation( () => { + return { + getUrl: jest.fn(), + }; + } ), }; }