mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-12-12 09:52:37 +00:00
[tests] migrate from jest to vitest (#3940)
This is a big change, but I think it's a good move, as `vitest` is much more modern than `jest`. I'm excited about the UI watch feature (run `npm run test:ui`), for example - it's really helpful and saves time when debugging tests. I had to adjust a few tests because they had time related issues, but basically we are now testing the same things - even a bit better and less flaky (I hope). What do you think?
This commit is contained in:
committed by
GitHub
parent
b542f33a0a
commit
462abf7027
@@ -10,7 +10,8 @@ describe("ipWhitelist directive configuration", () => {
|
||||
});
|
||||
|
||||
it("should reject request with 403 (Forbidden)", async () => {
|
||||
const res = await fetch("http://localhost:8181");
|
||||
const port = global.testPort || 8080;
|
||||
const res = await fetch(`http://localhost:${port}`);
|
||||
expect(res.status).toBe(403);
|
||||
});
|
||||
});
|
||||
@@ -24,7 +25,8 @@ describe("ipWhitelist directive configuration", () => {
|
||||
});
|
||||
|
||||
it("should allow request with 200 (OK)", async () => {
|
||||
const res = await fetch("http://localhost:8282");
|
||||
const port = global.testPort || 8080;
|
||||
const res = await fetch(`http://localhost:${port}`);
|
||||
expect(res.status).toBe(200);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user