test : just complete
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
import { readFile } from "node:fs/promises";
|
||||
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
import { afterAll, describe, expect, it } from "vitest";
|
||||
|
||||
vi.hoisted(() => {
|
||||
vi.stubEnv("BASE_URL", "https://guide.example.test");
|
||||
const originalBaseUrl = process.env.BASE_URL;
|
||||
process.env.BASE_URL = "https://guide.example.test";
|
||||
const { default: robots } = await import("@/app/robots");
|
||||
|
||||
afterAll(() => {
|
||||
if (originalBaseUrl === undefined) delete process.env.BASE_URL;
|
||||
else process.env.BASE_URL = originalBaseUrl;
|
||||
});
|
||||
|
||||
import robots from "@/app/robots";
|
||||
|
||||
async function repositoryFile(path: string): Promise<string> {
|
||||
return readFile(new URL(`../${path}`, import.meta.url), "utf8");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user