refactor: Refactor tests to not use module mocks, so bun test can be used
Some checks failed
CodeQL Scan / Analyze (javascript-typescript) (push) Failing after 45s
Build Docker Images / lint (push) Successful in 27s
Build Docker Images / check (push) Successful in 1m7s
Build Docker Images / tests (push) Failing after 6s
Build Docker Images / build (server, Dockerfile, ${{ github.repository_owner }}/server) (push) Has been skipped
Build Docker Images / build (worker, Worker.Dockerfile, ${{ github.repository_owner }}/worker) (push) Has been skipped
Deploy Docs to GitHub Pages / build (push) Failing after 12s
Mirror to Codeberg / Mirror (push) Failing after 0s
Deploy Docs to GitHub Pages / Deploy (push) Has been skipped
Nix Build / check (push) Failing after 32m31s

This commit is contained in:
Jesse Wierzbinski 2025-03-23 04:12:28 +01:00
parent ec506241f0
commit 7112a66e4c
No known key found for this signature in database
10 changed files with 71 additions and 527 deletions

View file

@ -1,5 +1,6 @@
import { describe, expect, it, mock } from "bun:test";
import { describe, expect, it } from "bun:test";
import sharp from "sharp";
import { mockModule } from "~/tests/utils.ts";
import { calculateBlurhash } from "./blurhash.ts";
describe("BlurhashPreprocessor", () => {
@ -49,7 +50,7 @@ describe("BlurhashPreprocessor", () => {
type: "image/png",
});
mock.module("blurhash", () => ({
using __ = await mockModule("blurhash", () => ({
encode: (): void => {
throw new Error("Test error");
},