Skip to content

Commit

Permalink
Merge branch 'main' into feat-cli-clearScreen
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Feb 21, 2024
2 parents c092a05 + 4ff7159 commit eee5d98
Show file tree
Hide file tree
Showing 72 changed files with 3,454 additions and 378 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ body:
id: reproduction
attributes:
label: Reproduction
description: Please provide a link to [StackBlitz](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/basic?initialPath=__vitest__/) or a github repo that can reproduce the problem you ran into. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed.
description: Please provide a link to [StackBlitz](https://stackblitz.com/fork/github/vitest-dev/vitest/tree/main/examples/basic?initialPath=__vitest__/) (you can also use [examples](https://github.com/vitest-dev/vitest/tree/main/examples)) or a github repo that can reproduce the problem you ran into. A [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) is required unless you are absolutely sure that the issue is obvious and the provided information is enough to understand the problem. If a report is vague (e.g. just a generic error message) and has no reproduction, it will receive a "need reproduction" label. If no reproduction is provided after 3 days, it will be auto-closed.
placeholder: Reproduction
validations:
required: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
os: [ubuntu-latest]
node_version: [18, 20]
include:
- os: macos-latest
- os: macos-14
node_version: 20
- os: windows-latest
node_version: 20
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
test-ui-e2e:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-14, windows-latest]
fail-fast: false

runs-on: ${{ matrix.os }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://vitest.new). Issues marked with `need reproduction` will be closed if they have no activity within 3 days.
Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://vitest.new) (you can also use [examples](https://github.com/vitest-dev/vitest/tree/main/examples)). Issues marked with `need reproduction` will be closed if they have no activity within 3 days.
7 changes: 4 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@ jobs:
with:
fetch-depth: 0

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Set node version to 20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: pnpm

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
CYPRESS_INSTALL_BINARY: '0'

- name: Build
run: pnpm build
Expand Down
14 changes: 6 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ flowchart TD
real --NO--> intended{Is the intended\nbehaviour?}
intended --YES--> explain[Explain and close\npoint to docs if needed]
intended --NO--> open[Keep open for discussion\nRemove 'pending triage' label]
real --YES--> real2["1. Remove 'pending triage' label\n2. Add 'bug' label\n3. Add related feature label if\napplicable (e.g. 'bug: ssr'\nor 'plugin: vue')\n4. Add priority label (see below)"]
real --YES--> real2["1. Remove 'pending triage' label\n2. Add related feature label if\napplicable (e.g. 'feat: browser')\n3. Add priority and meta labels (see below)"]
real2 --> unusable{Does the\nbug make Vitest\nunusable?}
unusable --YES--> maj{Does the bug\naffect the majority\nof Vitest users?}
maj --YES--> p5[p5: urgent]
maj --NO--> p4[p4: important]
unusable --NO--> workarounds{Are there\nworkarounds for\nthe bug?}
workarounds --YES--> p2[p2: has workaround]
workarounds --YES--> p2[p2: edge case\nhas workaround]
workarounds --NO--> p3[p3: minor bug]
```

Expand All @@ -122,14 +122,12 @@ flowchart TD
start{Bug fix\nor\nfeature}
start --BUG FIX--> strict_bug{"Is a 'strict fix'\ni.e. fixes an obvious\noversight with no\nside effects"}
start --FEATURE--> feature[- Discuss feature necessity\n- Is this the best way to address the need\n- Review code quality\n- Add feature labels\n- Approve if you feel strongly\nthat the feature is needed]
feature --> evan[Await input from Evan]
evan -.-> merge
feature --> merge
strict_bug --YES--> strict[- Verify the fix locally\n- Review code quality\n- Require test case if applicable\n- Request changes if necessary]
strict_bug --NO--> non_strict[Discuss the potential side\neffects of the fix, e.g.\n- Could it introduce implicit\nbehavior changes in other\ncases?\n- Does it introduce too much\nchanges?]
strict_bug --NO--> non_strict[- Discuss the potential side\neffects of the fix, e.g.\n- Could it introduce implicit\nbehavior changes in other\ncases?\n- Does it introduce too much\nchanges?]
non_strict --> label["Add priority labels\n(see issue triaging workflow)"]
label --> evan_non_strict[Await input from Evan]
evan_non_strict -.-> strict
strict --> approve
strict --> label
label --> approve
approve --> merge["Merge if approved by 2 or\nmore team members\n- Use 'Squash and Merge'\n- Edit commit message to follow\nconvention\n- In commit message body, list\nrelevant issues being fixed\ne.g. 'fix #1234, fix #1235'"]
```

Expand Down
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
MIT License

Copyright (c) 2021-Present Anthony Fu <https://github.com/antfu>
Copyright (c) 2021-Present Matias Capeletto <https://github.com/patak-dev>
Copyright (c) 2021-Present Vitest Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,10 @@ export default withPwa(defineConfig({
text: 'ExpectTypeOf',
link: '/api/expect-typeof',
},
{
text: 'Assert',
link: '/api/assert',
},
{
text: 'AssertType',
link: '/api/assert-type',
Expand Down
10 changes: 10 additions & 0 deletions docs/advanced/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,16 @@ const vitest = await createVitest('test', {
})
```
## parseCLI
You can use this method to parse CLI arguments. It accepts a string (where arguments are split by a single space) or a strings array of CLI arguments in the same format that Vitest CLI uses. It returns a filter and `options` that you can later pass down to `createVitest` or `startVitest` methods.
```ts
import { parseCLI } from 'vitest/node'

parseCLI('vitest ./files.ts --coverage --browser=chrome')
```
## Vitest
Vitest instance requires the current test mode. It can be either:
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export interface ProcessPool {

The function is called only once (unless the server config was updated), and it's generally a good idea to initialize everything you need for tests inside that function and reuse it when `runTests` is called.

Vitest calls `runTest` when new tests are scheduled to run. It will not call it if `files` is empty. The first argument is an array of tuples: the first element is a reference to a workspace project and the second one is an absolute path to a test file. Files are sorted using [`sequencer`](/config/#sequence.sequencer) before `runTests` is called. It's possible (but unlikely) to have the same file twice, but it will always have a different project - this is implemented via [`vitest.workspace.ts`](/guide/workspace) configuration.
Vitest calls `runTest` when new tests are scheduled to run. It will not call it if `files` is empty. The first argument is an array of tuples: the first element is a reference to a workspace project and the second one is an absolute path to a test file. Files are sorted using [`sequencer`](/config/#sequence-sequencer) before `runTests` is called. It's possible (but unlikely) to have the same file twice, but it will always have a different project - this is implemented via [`vitest.workspace.ts`](/guide/workspace) configuration.

Vitest will wait until `runTests` is executed before finishing a run (i.e., it will emit [`onFinished`](/guide/reporters) only after `runTests` is resolved).

Expand Down
Loading

0 comments on commit eee5d98

Please sign in to comment.