Skip to content

Commit

Permalink
Updaing snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
samkevin1 committed Mar 13, 2023
1 parent 1fa8795 commit cf8febf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/runner/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const callCleanupHooks = async (cleanups: HookCleanupCallback[]) => {
export async function runTest(test: Test, runner: VitestRunner) {
await runner.onBeforeRunTest?.(test)

if (test.mode !== 'run' && !test.repeats)
if (test.mode !== 'run')
return

if (test.result?.state === 'fail') {
Expand Down
2 changes: 1 addition & 1 deletion packages/runner/src/suite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function createSuiteCollector(name: string, factory: SuiteFactory = () => { }, m
initSuite()

const test = createTest(function (name: string, fn = noop, options = suiteOptions) {
const mode = this.only ? 'only' : this.skip ? 'skip' : this.todo ? 'todo' : this.repeats ? 'repeats' : 'run'
const mode = this.only ? 'only' : this.skip ? 'skip' : this.todo ? 'todo' : 'run'

if (typeof options === 'number')
options = { timeout: options }
Expand Down
2 changes: 1 addition & 1 deletion packages/runner/src/utils/collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function interpretTaskModes(suite: Suite, namePattern?: string | RegExp,

// if all subtasks are skipped, mark as skip
if (suite.mode === 'run') {
if (suite.tasks.length && suite.tasks.every(i => i.mode !== 'run' && !i.repeats))
if (suite.tasks.length && suite.tasks.every(i => i.mode !== 'run'))
suite.mode = 'skip'
}
}
Expand Down
3 changes: 3 additions & 0 deletions test/reporters/tests/__snapshots__/html.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ exports[`html reporter > resolves to "failing" status for test file "json-fail"
"afterEach": "pass",
"beforeEach": "pass",
},
"repeatCount": 0,
"retryCount": 0,
"startTime": 0,
"state": "fail",
Expand Down Expand Up @@ -141,6 +142,7 @@ exports[`html reporter > resolves to "passing" status for test file "all-passing
"afterEach": "pass",
"beforeEach": "pass",
},
"repeatCount": 0,
"retryCount": 0,
"startTime": 0,
"state": "pass",
Expand Down Expand Up @@ -187,6 +189,7 @@ exports[`html reporter > resolves to "passing" status for test file "all-passing
"afterEach": "pass",
"beforeEach": "pass",
},
"repeatCount": 0,
"retryCount": 0,
"startTime": 0,
"state": "pass",
Expand Down

0 comments on commit cf8febf

Please sign in to comment.