test: run the suite and benchmark with Bun's native test runner
Replace Vitest with bun test across the whole suite. A preload compiles components through Angular's JIT transform with inlined templates, sets up jsdom, TestBed and zoneless change detection, and a small shim covers the Vitest APIs bun:test lacks. Files run isolated, real-worker specs spawn the running Bun, and line coverage from lcov is converted to the existing HTML and Cobertura reports. The CI benchmark replaces its heap cap with a container memory limit. Vitest, Jest, Nx and their Vite configuration are removed. Refs #291 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
558c70aa24
commit
94d57add2c
44 files changed
+446
-6481
No files matched your search
@@ -0,0 +1,31 @@
|
||||
// Converts coverage/lcov.info (Bun) to HTML and Cobertura. Run: bun scripts/coverage-reports.mjs
|
||||
// shortcut: line coverage only, Bun's lcov has no usable branch/function data; revisit if Bun adds it.
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
import libCoverage from 'istanbul-lib-coverage';
|
||||
import libReport from 'istanbul-lib-report';
|
||||
import reports from 'istanbul-reports';
|
||||
|
||||
const map = libCoverage.createCoverageMap({});
|
||||
const loc = (line) => ({ start: { line, column: 0 }, end: { line, column: 1 } });
|
||||
for (const record of readFileSync('coverage/lcov.info', 'utf8').split('end_of_record')) {
|
||||
const file = /^SF:(.+)$/m.exec(record)?.[1];
|
||||
if (!file) continue;
|
||||
const statementMap = {};
|
||||
const s = {};
|
||||
for (const [, line, hits] of record.matchAll(/^DA:(\d+),(\d+)/gm)) {
|
||||
statementMap[line] = loc(+line);
|
||||
s[line] = +hits;
|
||||
}
|
||||
map.addFileCoverage({
|
||||
path: resolve(file),
|
||||
statementMap,
|
||||
s,
|
||||
fnMap: {},
|
||||
f: {},
|
||||
branchMap: {},
|
||||
b: {},
|
||||
});
|
||||
}
|
||||
const context = libReport.createContext({ dir: 'coverage', coverageMap: map });
|
||||
for (const name of ['html', 'cobertura']) reports.create(name).execute(context);
|
||||
Reference in new issue
Block a user