chore(site): enable vitest valid-expect (#32841)

This commit is contained in:
Jake Howell authored and GitHub committed 2026-12-02 04:39:28 +11:00
1 parent 0f9f531495
commit d25f23bf04
5 files changed
+24 -12

No files matched your search

+1 -1
View File
@@ -116,6 +116,7 @@
"static-components": "error",
"no-conditional-tests": "error",
"vitest/require-to-throw-message": "error",
"vitest/valid-expect": "error",
"no-useless-fallback-in-spread": "error",
"no-noninteractive-element-interactions": "error",
"no-autofocus": "error",
@@ -232,7 +233,6 @@
"globals": "off", // (small)
"no-static-element-interactions": "off", // (small)
"immutability": "off", // (small)
"vitest/valid-expect": "off", // (small)
"purity": "off", // (small)
// react-you-might-not-need-an-effect rules with existing violations.
+4 -3
View File
@@ -725,9 +725,10 @@ describe("invalidateChatListQueries", () => {
name === "unfiltered" ||
name === "all" ||
matchingFilters.includes(name);
expect(readInfiniteChats(queryClient, input), name).toEqual(
matches ? [chat] : [],
);
expect(
readInfiniteChats(queryClient, input),
`list cache for the ${name} filter`,
).toEqual(matches ? [chat] : []);
}
},
);
@@ -202,7 +202,10 @@ describe("isKnownComputerUseModel", () => {
"global.anthropic.claude-sonnet-5-5",
"anthropic.claude-opus-5-v1:0",
]) {
expect(isKnownComputerUseModel("anthropic", modelId), modelId).toBe(true);
expect(
isKnownComputerUseModel("anthropic", modelId),
`Bedrock model ${modelId} should support computer use`,
).toBe(true);
}
});
@@ -77,8 +77,10 @@ describe("knownModelsGenerated", () => {
]) {
const value = record[field];
if (value !== undefined) {
expect(typeof value, field).toBe("number");
expect(value, field).toBeGreaterThan(0);
expect(typeof value, `${model.modelIdentifier}.${field}`).toBe(
"number",
);
expect(value, `${model.modelIdentifier}.${field}`).toBeGreaterThan(0);
}
}
for (const field of [
@@ -89,8 +91,13 @@ describe("knownModelsGenerated", () => {
]) {
const value = record[field];
if (value !== undefined) {
expect(typeof value, field).toBe("number");
expect(value, field).toBeGreaterThanOrEqual(0);
expect(typeof value, `${model.modelIdentifier}.${field}`).toBe(
"number",
);
expect(
value,
`${model.modelIdentifier}.${field}`,
).toBeGreaterThanOrEqual(0);
}
}
}
+4 -3
View File
@@ -261,9 +261,10 @@ describe("theme CSS variables", () => {
const base = extractEffectiveBlock(css, `.${baseModeFor(name)}`) ?? "";
for (const role of ["success", "error", "warning"]) {
for (const variable of [`--chart-${role}`, `--chart-${role}-border`]) {
expect(extractVariable(variant, variable), variable).not.toBe(
extractVariable(base, variable),
);
expect(
extractVariable(variant, variable),
`${name} should adapt ${variable} for colorblind users`,
).not.toBe(extractVariable(base, variable));
}
}
},