Skip to content

Commit

Permalink
Fix manifestParser readFile url
Browse files Browse the repository at this point in the history
  • Loading branch information
willybrauner committed Feb 7, 2024
1 parent 0f3f62e commit aa4884d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions apps/front/prerender/__tests__/ManifestParser.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { expect, it } from "vitest"
import { ManifestParser } from "../helpers/ManifestParser"
import * as mfs from "@cher-ami/mfs"
import config from "../../config/config.js"
import path from "path"
import { fileURLToPath } from "url"
import * as fs from "fs"
const url = import.meta.url

// @ts-ignore
const manifestRaw = await mfs.readFile(`${config.outDirStatic}/manifest.json`)
const manifestRaw = fs.readFileSync(
path.join(path.dirname(fileURLToPath(url)), `fixtures/manifest.json`),
{ encoding: "utf8" },
)

it("should return assets list", () => {
const assets = ManifestParser.getAssets(manifestRaw)
Expand Down

0 comments on commit aa4884d

Please sign in to comment.