Adds a mock for cloudflare workers to enable testing of code that relies on the cloudflare workers environment.
25 lines
867 B
TypeScript
25 lines
867 B
TypeScript
import { mock } from "bun:test";
|
|
|
|
mock.module("cloudflare:workers", () => ({
|
|
env: {
|
|
ADMIN_SDK_JSON: JSON.stringify({
|
|
type: "service_account",
|
|
projectId: "test-26g38",
|
|
privateKeyId: "privateKeyId",
|
|
privateKey: "privateKey",
|
|
clientEmail: "test@test.com",
|
|
clientID: "clientId",
|
|
authURI: "https://accounts.google.com/o/oauth2/auth",
|
|
tokenURI: "https://oauth2.googleapis.com/token",
|
|
authProviderX509CertUrl: "https://www.googleapis.com/oauth2/v1/certs",
|
|
clientX509CertUrl:
|
|
"https://www.googleapis.com/robot/v1/metadata/x509/test%40test.com",
|
|
universeDomain: "aniplay.com",
|
|
}),
|
|
ANIWATCH_URL: "https://aniwatch.to",
|
|
CONSUMET_URL: "https://api.consumet.org",
|
|
ANILIST_URL: "https://graphql.anilist.co",
|
|
GOOGLE_AUTH_URL: "https://www.googleapis.com/oauth2/v4/token",
|
|
},
|
|
}));
|