Translation swap added

This commit is contained in:
David
2021-03-18 23:47:12 +01:00
parent 535f791455
commit 2bc931a4d3
7 changed files with 107 additions and 50 deletions

View File

@@ -12,11 +12,11 @@ describe("googleScrape", () => {
});
it("parses html response correctly", async () => {
const translation = faker.random.words();
const html = htmlRes(translation);
const translationRes = faker.random.words();
const html = htmlRes(translationRes);
resolveFetchWith(html);
expect(await googleScrape(source, target, query)).toStrictEqual({ translation });
expect(await googleScrape(source, target, query)).toStrictEqual({ translationRes });
});
it("returns status code on request error", async () => {