diff --git a/tests/fetchWakatime.test.js b/tests/fetchWakatime.test.js index 6735a05a47bea..fb337345bef0b 100644 --- a/tests/fetchWakatime.test.js +++ b/tests/fetchWakatime.test.js @@ -205,13 +205,21 @@ describe("Wakatime fetcher", () => { `); }); - it("should throw error", async () => { + it("should throw error if username param missing", async () => { mock.onGet(/\/https:\/\/wakatime\.com\/api/).reply(404, wakaTimeData); await expect(fetchWakatimeStats("noone")).rejects.toThrow( 'Missing params "username" make sure you pass the parameters in URL', ); }); + + it("should throw error if username is not found", async () => { + mock.onGet(/\/https:\/\/wakatime\.com\/api/).reply(404, wakaTimeData); + + await expect(fetchWakatimeStats({ username: "noone" })).rejects.toThrow( + "Could not resolve to a User with the login of 'noone'", + ); + }); }); export { wakaTimeData };