fix(insomnia-test): use import.meta.dirname instead of __dirname in ESM specs

insomnia-test is "type": "module", so __dirname is undefined and
`playwright test --list` collected 0 tests, failing the Shard Matrix job.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Bob QiuandClaude Sonnet 5.5 committed 2026-11-04 17:34:15 +08:00
1 parent 4548870d2f
commit bcaf57f60a
4 files changed
+9 -9

No files matched your search

@@ -9,8 +9,8 @@ import { test } from "../../../misc/fixtures";
import { Collection } from "../../../models/collection";
import { Project } from "../../../models/project";
const VALID_RULESET = path.join(__dirname, "custom.spectral.yaml");
const INVALID_RULESET = path.join(__dirname, "invalid.spectral.yaml");
const VALID_RULESET = path.join(import.meta.dirname, "custom.spectral.yaml");
const INVALID_RULESET = path.join(import.meta.dirname, "invalid.spectral.yaml");
test("Verify Custom Spectral Ruleset Upload, Removal, And Rejection Of An Invalid Ruleset", async ({
user,
@@ -9,7 +9,7 @@ import { test } from "../../../misc/fixtures";
import { Project } from "../../../models/project";
const UNIT_TEST_FIXTURE = fs.readFileSync(
path.join(__dirname, "unit-test.yaml"),
path.join(import.meta.dirname, "unit-test.yaml"),
"utf8",
);
@@ -36,7 +36,7 @@ test("Verify a quoted CSV field containing a comma is uploaded as a single value
});
const result = await workspaceFlow.run(collection, {
dataFilePath: path.join(__dirname, "quoted-comma.csv"),
dataFilePath: path.join(import.meta.dirname, "quoted-comma.csv"),
});
expect(result.testResultCount).toEqual({ passed: 1, total: 1 });
@@ -65,7 +65,7 @@ test("Verify escaped double quotes inside a quoted CSV field are unescaped to a
});
const result = await workspaceFlow.run(collection, {
dataFilePath: path.join(__dirname, "escaped-quotes.csv"),
dataFilePath: path.join(import.meta.dirname, "escaped-quotes.csv"),
});
expect(result.testResultCount).toEqual({ passed: 1, total: 1 });
@@ -101,7 +101,7 @@ test("Verify a CSV row with fewer cells than the header defaults the missing tra
});
const result = await workspaceFlow.run(collection, {
dataFilePath: path.join(__dirname, "missing-trailing-cell.csv"),
dataFilePath: path.join(import.meta.dirname, "missing-trailing-cell.csv"),
});
expect(result.testResultCount).toEqual({
@@ -134,7 +134,7 @@ test("Verify a newline inside a quoted CSV field is preserved as part of a singl
});
const result = await workspaceFlow.run(collection, {
dataFilePath: path.join(__dirname, "newline-in-quoted-field.csv"),
dataFilePath: path.join(import.meta.dirname, "newline-in-quoted-field.csv"),
});
expect(result.testResultCount).toEqual({ passed: 1, total: 1 });
@@ -164,7 +164,7 @@ test("Verify a trailing blank line in the CSV file does not produce an extra bog
});
const result = await workspaceFlow.run(collection, {
dataFilePath: path.join(__dirname, "trailing-blank-line.csv"),
dataFilePath: path.join(import.meta.dirname, "trailing-blank-line.csv"),
});
expect(result.testResultCount).toEqual({ passed: 1, total: 1 });
@@ -10,7 +10,7 @@ import { Collection } from "../../../models/collection";
import { Project } from "../../../models/project";
const url = `${HTTP_SERVER}/post`;
const dataFilePath = path.join(__dirname, "runner-data.json");
const dataFilePath = path.join(import.meta.dirname, "runner-data.json");
const expectedGreetings = ["hello", "bonjour", "hola"];
test("Verify Uploaded Data File Drives Runner Iterations", async ({ user }) => {