test(web): extend timeout for ExcelJS-based excel import tests
CI / Architecture Guardrails (push) Successful in 3m44s
CI / Assistant Split Regression (push) Successful in 5m16s
CI / Typecheck (push) Successful in 7m23s
CI / Lint (push) Successful in 8m20s
CI / Unit Tests (push) Successful in 8m22s
CI / E2E Tests (push) Failing after 5m12s
CI / Fresh-Linux Docker Deploy (push) Failing after 8m19s
CI / Release Images (push) Has been skipped
CI / Build (push) Successful in 7m34s

ExcelJS dynamic import + workbook writeBuffer exceeds the default 5s
vitest timeout on the constrained QNAP CI runner, matching the same
pattern already applied to skillMatrixParser.test.ts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-13 02:52:54 +02:00
parent 1006167e76
commit ee84f6e316
+9 -19
View File
@@ -1,14 +1,7 @@
import { describe, expect, it } from "vitest";
import {
MAX_BROWSER_SPREADSHEET_BYTES,
assertSpreadsheetFile,
parseSpreadsheet,
} from "./excel.js";
import { MAX_BROWSER_SPREADSHEET_BYTES, assertSpreadsheetFile, parseSpreadsheet } from "./excel.js";
async function createWorkbookFile(
rows: unknown[][],
fileName = "spreadsheet.xlsx",
): Promise<File> {
async function createWorkbookFile(rows: unknown[][], fileName = "spreadsheet.xlsx"): Promise<File> {
const ExcelJS = await import("exceljs");
const workbook = new ExcelJS.Workbook();
const worksheet = workbook.addWorksheet("Sheet1");
@@ -25,11 +18,9 @@ async function createWorkbookFile(
describe("excel import helpers", () => {
it("parses csv files with quoted values and skips blank rows", async () => {
const file = new File(
['name,role\n"Alice, A.",Engineer\n\nBob,Producer\n'],
"people.csv",
{ type: "text/csv" },
);
const file = new File(['name,role\n"Alice, A.",Engineer\n\nBob,Producer\n'], "people.csv", {
type: "text/csv",
});
await expect(parseSpreadsheet(file)).resolves.toEqual([
{ name: "Alice, A.", role: "Engineer" },
@@ -38,6 +29,7 @@ describe("excel import helpers", () => {
});
it("parses xlsx files and normalizes date cells to ISO strings", async () => {
// ExcelJS dynamic import + workbook writeBuffer is slow on constrained CI runners.
const file = await createWorkbookFile([
["name", "startDate", "active"],
["Alice", new Date("2026-03-30T09:15:00.000Z"), true],
@@ -50,7 +42,7 @@ describe("excel import helpers", () => {
active: "true",
},
]);
});
}, 30000);
it("rejects duplicate headers in xlsx imports", async () => {
const file = await createWorkbookFile([
@@ -59,16 +51,14 @@ describe("excel import helpers", () => {
]);
await expect(parseSpreadsheet(file)).rejects.toThrow('duplicate header "name"');
});
}, 30000);
it("rejects legacy .xls uploads before parsing", () => {
const file = new File(["legacy"], "legacy.xls", {
type: "application/vnd.ms-excel",
});
expect(() => assertSpreadsheetFile(file)).toThrow(
"Legacy .xls files are not supported.",
);
expect(() => assertSpreadsheetFile(file)).toThrow("Legacy .xls files are not supported.");
});
it("rejects oversized spreadsheet uploads before parsing", () => {