Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhubail committed Oct 30, 2024
1 parent e2e59aa commit beba5a5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions packages/vitest/src/node/cli/cac.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import type { VitestRunMode } from '../types/config'
import { collectAndProcess, type CliOptions } from './cli-api'
import type { CLIOption, CLIOptions as CLIOptionsConfig } from './cli-config'
import { toArray } from '@vitest/utils'
import cac, { type CAC, type Command } from 'cac'
import { normalize } from 'pathe'
import c from 'tinyrainbow'
import { version } from '../../../package.json' with { type: 'json' }
import { type CliOptions, collectAndProcess } from './cli-api'
import { benchCliOptionsConfig, cliOptionsConfig, collectCliOptionsConfig } from './cli-config'
import { IncludeTaskLocationDisabledError, RangeLocationFilterProvidedError } from '../errors'

function addCommand(cli: CAC | Command, name: string, option: CLIOption<any>) {
const commandName = option.alias || name
Expand Down
5 changes: 3 additions & 2 deletions packages/vitest/src/node/cli/cli-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import type { Vitest, VitestOptions } from '../core'
import type { WorkspaceSpec } from '../pool'
import type { UserConfig, VitestEnvironment, VitestRunMode } from '../types/config'
import { mkdirSync, writeFileSync } from 'node:fs'
import { normalize } from 'node:path'
import { getNames, getTests } from '@vitest/runner/utils'
import { dirname, relative, resolve } from 'pathe'
import { CoverageProviderMap } from '../../integrations/coverage'
import { groupBy } from '../../utils/base'
import { createVitest } from '../create'
import { FilesNotFoundError, GitNotFoundError, IncludeTaskLocationDisabledError, RangeLocationFilterProvidedError } from '../errors'
import { registerConsoleShortcuts } from '../stdin'
import { normalize } from 'node:path'

export interface CliOptions extends UserConfig {
/**
Expand Down Expand Up @@ -198,7 +198,8 @@ export async function collectAndProcess(
}

await ctx.close()
} catch (e) {
}
catch (e) {
if (
e instanceof IncludeTaskLocationDisabledError
|| e instanceof RangeLocationFilterProvidedError
Expand Down
4 changes: 2 additions & 2 deletions test/cli/test/list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ test('error if range location is provided', async () => {
const { stdout, stderr } = await runVitestCli(
'list',
'-r=./fixtures/list',
'a/file/that/doesnt/exit:10-15'
'a/file/that/doesnt/exit:10-15',
)

expect(stdout).toEqual('')
Expand All @@ -309,7 +309,7 @@ test('erorr if location filter provided without enabling includeTaskLocation', a
'list',
'-r=./fixtures/list',
'--config=no-task-location.config.ts',
'a/file/that/doesnt/exist:5'
'a/file/that/doesnt/exist:5',
)

expect(stdout).toEqual('')
Expand Down

0 comments on commit beba5a5

Please sign in to comment.