Skip to content

Commit

Permalink
failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Aslemammad committed Sep 15, 2022
1 parent cc3216e commit d6bd19b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -6,7 +6,7 @@
"packageManager": "pnpm@7.10.0",
"description": "A blazing fast unit test framework powered by Vite",
"scripts": {
"ci": "ni && nr typecheck && nr lint && nr build && nr test:all && nr bench:all",
"ci": "ni && nr typecheck && nr lint && nr build && nr test:all",
"build": "pnpm -r --filter=./packages/** run build",
"dev": "cross-env NODE_OPTIONS=\"--max-old-space-size=8192\" pnpm -r --parallel --filter=./packages/** run dev",
"docs": "pnpm -C docs run dev",
Expand All @@ -19,7 +19,6 @@
"lint": "eslint .",
"lint:fix": "nr lint --fix",
"release": "bumpp package.json packages/*/package.json --commit --push --tag && pnpm -r publish --access public",
"bench:all": "cross-env CI=true pnpm -r --stream run bench --allowOnly",
"test": "vitest --api -r test/core",
"test:run": "vitest run -r test/core",
"test:all": "cross-env CI=true pnpm -r --stream run test --allowOnly",
Expand Down
4 changes: 3 additions & 1 deletion test/benchmark/package.json
Expand Up @@ -2,6 +2,8 @@
"name": "@vitest/benchmark",
"private": true,
"scripts": {
"bench": "vitest bench"
"test": "node test.mjs",
"testu": "vitest -u",
"coverage": "vitest run --coverage"
}
}
6 changes: 5 additions & 1 deletion test/benchmark/test.mjs
@@ -1,7 +1,7 @@
import { readFile } from 'fs/promises'
import { startVitest } from 'vitest/node'

const success = await startVitest('benchmark', ['base.bench', 'mode.bench'], {
const success = await startVitest('benchmark', ['base.bench', 'mode.bench', 'only.bench'], {
run: true,
update: false,
outputFile: './bench.json', // TODO move outputFile to benchmark
Expand All @@ -15,4 +15,8 @@ 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)

process.exit(success ? 0 : 1)
4 changes: 2 additions & 2 deletions test/benchmark/test/only.bench.ts
@@ -1,13 +1,13 @@
import assert from 'node:assert'
import { bench, describe, expect } from 'vitest'

const run = [false, false, false, false]
const run = [false, false, false, false, false]

describe('a0', () => {
bench.only('0', () => {
run[0] = true
})
bench('s0', () => {
bench.only('s0', () => {
expect(true).toBe(false)
})
})
Expand Down

0 comments on commit d6bd19b

Please sign in to comment.