mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
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:
@@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user