Skip to content

Commit df2227e

Browse files
committed
fix(webapp): resolve a test's route paths from the test, not the repo root
The queue-JWT test read its route sources through repo-root-relative paths, so it never resolved from the webapp's own working directory.
1 parent 8adf2b2 commit df2227e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/webapp/test/queueRetrieveJwt.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { readFileSync } from "node:fs";
2+
import { fileURLToPath } from "node:url";
23
import { describe, expect, it } from "vitest";
34

45
/**
@@ -7,8 +8,9 @@ import { describe, expect, it } from "vitest";
78
* retrieve route the agent got a 401, which reaches the model as absent data and had it
89
* telling users a queue of thousands of runs did not exist.
910
*/
10-
const ROUTE = "apps/webapp/app/routes/api.v1.queues.$queueParam.ts";
11-
const METRICS = "apps/webapp/app/routes/api.v1.queues.$queueParam.metrics.ts";
11+
const WEBAPP_ROOT = fileURLToPath(new URL("..", import.meta.url));
12+
const ROUTE = `${WEBAPP_ROOT}app/routes/api.v1.queues.$queueParam.ts`;
13+
const METRICS = `${WEBAPP_ROOT}app/routes/api.v1.queues.$queueParam.metrics.ts`;
1214

1315
describe("queue retrieve accepts an environment JWT", () => {
1416
const source = readFileSync(ROUTE, "utf8");

0 commit comments

Comments
 (0)