refactor!: migrate away from bun
- migrate package management to pnpm - migrate test suite to vitest - also remove Anify integration
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { fetchFromMultipleSources } from "./fetchFromMultipleSources";
|
||||
|
||||
describe("fetchFromMultipleSources", () => {
|
||||
it("no promises, throws exception", () => {
|
||||
expect(() => fetchFromMultipleSources([])).toThrow(
|
||||
it("no promises, throws exception", async () => {
|
||||
await expect(fetchFromMultipleSources([])).rejects.toThrow(
|
||||
"fetchPromises cannot be empty",
|
||||
);
|
||||
});
|
||||
@@ -30,7 +30,7 @@ describe("fetchFromMultipleSources", () => {
|
||||
() => Promise.resolve(3),
|
||||
]);
|
||||
|
||||
expect(errorOccurred).toBeFalse();
|
||||
expect(errorOccurred).toBe(false);
|
||||
});
|
||||
|
||||
it("has promises that all throw, returns null", async () => {
|
||||
@@ -48,7 +48,7 @@ describe("fetchFromMultipleSources", () => {
|
||||
() => Promise.reject(new Error("error")),
|
||||
]);
|
||||
|
||||
expect(errorOccurred).toBeTrue();
|
||||
expect(errorOccurred).toBe(true);
|
||||
});
|
||||
|
||||
it("has promises but cache has value, returns cached value", async () => {
|
||||
@@ -80,7 +80,7 @@ describe("fetchFromMultipleSources", () => {
|
||||
},
|
||||
);
|
||||
|
||||
expect(errorOccurred).toBeFalse();
|
||||
expect(errorOccurred).toBe(false);
|
||||
});
|
||||
|
||||
it("has promises, no cached value, no valid response, should not save in cache", async () => {
|
||||
|
||||
Reference in New Issue
Block a user