release: WRNexusJS 0.8.0
Quality / quality (ubuntu-latest) (push) Failing after 21s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-02 23:18:51 +05:30
parent 87507edf59
commit 586a6db8ff
625 changed files with 243608 additions and 11210 deletions
+27
View File
@@ -0,0 +1,27 @@
import { afterAll } from "bun:test";
const originalWarn = console.warn;
const warnings: string[] = [];
const allowed = (process.env.WRNEXUS_TEST_WARNING_ALLOWLIST ?? "")
.split(",")
.map((value) => value.trim())
.filter(Boolean);
console.warn = (...values: unknown[]) => {
const message = values
.map((value) => (typeof value === "string" ? value : JSON.stringify(value)))
.join(" ");
if (!allowed.some((pattern) => message.includes(pattern))) warnings.push(message);
originalWarn(...values);
};
afterAll(() => {
console.warn = originalWarn;
if (warnings.length) {
throw new Error(
`WRN-TEST-UNEXPECTED-WARNING: ${warnings.length} warning(s) emitted:\n${warnings
.map((warning) => `- ${warning}`)
.join("\n")}`,
);
}
});