Skip to content

Commit

Permalink
docs: update cli docs (#2159)
Browse files Browse the repository at this point in the history
  • Loading branch information
dammy001 committed Oct 19, 2022
1 parent 42d7278 commit 17ba76b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -19,6 +19,9 @@ bench/test/*/*/
cypress/videos
cypress/downloads
cypress/screenshots
packages/ui/cypress/videos
packages/ui/cypress/downloads
packages/ui/cypress/screenshots
docs/public/user-avatars
docs/public/sponsors
.eslintcache
Expand Down
2 changes: 2 additions & 0 deletions docs/guide/cli.md
Expand Up @@ -76,6 +76,8 @@ vitest related /src/index.ts /src/hello-world.js
| `--shard <shard>` | Execute tests in a specified shard |
| `--sequence` | Define in what order to run tests. Use [cac's dot notation] to specify options (for example, use `--sequence.shuffle` to run tests in random order) |
| `--no-color` | Removes colors from the console output |
| `--inspect` | Enables Node.js inspector |
| `--inspect-brk` | Enables Node.js inspector with break |
| `-h, --help` | Display available CLI options |

### changed
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/client/components/dashboard/DashboardEntry.vue
Expand Up @@ -12,7 +12,7 @@ withDefaults(defineProps<{ tail?: boolean }>(), { tail: false })
<slot name="header" />
</div>
</div>
<!--
<!--
<div v-if="!tail" data-testid="tail" my-0 op50 w-2px bg-current origin-center rotate-0 translate-x-3 />
-->
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/client/composables/module-graph.ts
@@ -1,6 +1,6 @@
import type { Graph, GraphConfig, GraphController, GraphLink, GraphNode } from 'd3-graph-controller'
import { defineGraph, defineLink, defineNode } from 'd3-graph-controller'
import type { ModuleGraphData } from '../../../vitest/src/types'
import type { ModuleGraphData } from 'vitest/src/types'

export type ModuleType = 'external' | 'inline'
export type ModuleNode = GraphNode<ModuleType>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/index.html
Expand Up @@ -21,4 +21,4 @@
<div id="app"></div>
<script type="module" src="/client/main.ts"></script>
</body>
</html>
</html>
10 changes: 5 additions & 5 deletions packages/vitest/src/node/cli.ts
Expand Up @@ -71,28 +71,28 @@ cli

cli.parse()

async function runRelated(relatedFiles: string[] | string, argv: CliOptions) {
async function runRelated(relatedFiles: string[] | string, argv: CliOptions): Promise<void> {
argv.related = relatedFiles
argv.passWithNoTests ??= true
await start('test', [], argv)
}

async function watch(cliFilters: string[], options: CliOptions) {
async function watch(cliFilters: string[], options: CliOptions): Promise<void> {
options.watch = true
await start('test', cliFilters, options)
}

async function run(cliFilters: string[], options: CliOptions) {
async function run(cliFilters: string[], options: CliOptions): Promise<void> {
options.run = true
await start('test', cliFilters, options)
}

async function benchmark(cliFilters: string[], options: CliOptions) {
async function benchmark(cliFilters: string[], options: CliOptions): Promise<void> {
console.warn(c.yellow('Benchmarking is an experimental feature.\nBreaking changes might not follow semver, please pin Vitest\'s version when using it.'))
await start('benchmark', cliFilters, options)
}

async function start(mode: VitestRunMode, cliFilters: string[], options: CliOptions) {
async function start(mode: VitestRunMode, cliFilters: string[], options: CliOptions): Promise<void> {
try {
if (await startVitest(mode, cliFilters, options) === false)
process.exit()
Expand Down
13 changes: 6 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 17ba76b

Please sign in to comment.