enable eslint jest/expect-expect and jest/no-done-callback (#3272)

follow up to https://github.com/MichMich/MagicMirror/pull/3270
This commit is contained in:
Karsten Hassel
2023-11-22 23:37:17 +01:00
committed by GitHub
parent 7098f1e41f
commit 6ffdc7b55b
20 changed files with 385 additions and 327 deletions

View File

@@ -4,6 +4,7 @@ describe("Compliments module", () => {
/**
* move similar tests in function doTest
* @param {Array} complimentsArray The array of compliments.
* @returns {boolean} result
*/
const doTest = async (complimentsArray) => {
let elem = await helpers.waitForElement(".compliments");
@@ -11,6 +12,7 @@ describe("Compliments module", () => {
elem = await helpers.waitForElement(".module-content");
expect(elem).not.toBeNull();
expect(complimentsArray).toContain(elem.textContent);
return true;
};
afterAll(async () => {
@@ -25,7 +27,7 @@ describe("Compliments module", () => {
});
it("shows anytime because if configure empty parts of day compliments and set anytime compliments", async () => {
await doTest(["Anytime here"]);
await expect(doTest(["Anytime here"])).resolves.toBe(true);
});
});
@@ -36,7 +38,7 @@ describe("Compliments module", () => {
});
it("shows anytime compliments", async () => {
await doTest(["Anytime here"]);
await expect(doTest(["Anytime here"])).resolves.toBe(true);
});
});
});
@@ -48,7 +50,7 @@ describe("Compliments module", () => {
});
it("should show compliments from a remote file", async () => {
await doTest(["Remote compliment file works!"]);
await expect(doTest(["Remote compliment file works!"])).resolves.toBe(true);
});
});
});