Skip to content
This repository has been archived by the owner on Mar 1, 2019. It is now read-only.

Commit

Permalink
tests: ensure init.spec mocks used getUrl method
Browse files Browse the repository at this point in the history
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
  • Loading branch information
wiese committed Dec 20, 2018
1 parent 63b7cb3 commit 3ac4749
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/unit/client/init.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
};
} ),
};
}

Expand Down

0 comments on commit 3ac4749

Please sign in to comment.