Skip to content

Commit

Permalink
chore: find working dir for test
Browse files Browse the repository at this point in the history
Signed-off-by: Case Wylie <[email protected]>
  • Loading branch information
cmwylie19 committed Oct 30, 2024
1 parent 3f083ab commit abeb3ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion journey/entrypoint-wasm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { promises as fs } from "fs";
import { peprBuild } from "./pepr-build-wasm";
import { resolve } from "path";
import { cwd } from "./entrypoint.test";
import { exec } from "child_process";

// Unmock unit test things
jest.deepUnmock("pino");
Expand All @@ -14,6 +15,7 @@ jest.deepUnmock("pino");
jest.setTimeout(1000 * 60 * 5);
export const outputDir = "dist/pepr-test-module/child/folder";
beforeAll(async () => {
const dir = resolve(cwd);
await fs.mkdir(outputDir, { recursive: true });
await addScopedRbacMode();
});
Expand All @@ -24,9 +26,9 @@ describe(

// Set rbacMode in the Pepr Module Config and write it back to disk
async function addScopedRbacMode() {
exec("ls -la", { cwd });
const packageJson = await fs.readFile(resolve(cwd, "package.json"), "utf8");
const packageJsonObj = JSON.parse(packageJson);
console.log(JSON.stringify(packageJsonObj.pepr));
packageJsonObj.pepr.rbacMode = "scoped";
await fs.writeFile(resolve(cwd, "package.json"), JSON.stringify(packageJsonObj, null, 2));
}

0 comments on commit abeb3ee

Please sign in to comment.