mirror of
https://github.com/vitest-dev/vitest.git
synced 2025-12-08 18:26:03 +00:00
* fix: use "node:" prefix in Vitest imports * chore: add test for prefix * chore: cleanup * chore: use more node protocol * chore: cleanup * chore: cleanup
35 lines
741 B
JavaScript
35 lines
741 B
JavaScript
import { readFile } from 'node:fs/promises'
|
|
import { execa } from 'execa'
|
|
|
|
let error
|
|
await execa('npx', ['vitest', 'bench', 'base.bench', 'mode.bench', 'only.bench'], {
|
|
env: {
|
|
...process.env,
|
|
CI: 'true',
|
|
NO_COLOR: 'true',
|
|
},
|
|
})
|
|
.catch((e) => {
|
|
error = e
|
|
})
|
|
|
|
if (error) {
|
|
console.error(error)
|
|
process.exit(1)
|
|
}
|
|
|
|
const benchResult = await readFile('./bench.json', 'utf-8')
|
|
|
|
if (benchResult.includes('skip'))
|
|
process.exit(1)
|
|
|
|
const skippedBenches = ['s0', 's1', 's2', 's3', 'sb4', 's4']
|
|
if (skippedBenches.some(b => benchResult.includes(b)))
|
|
process.exit(1)
|
|
|
|
const todoBenches = ['unimplemented suite', 'unimplemented test']
|
|
if (todoBenches.some(b => benchResult.includes(b)))
|
|
process.exit(1)
|
|
|
|
process.exit(0)
|