Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SEO 18.] Add more docs + Vitest #224

Merged
merged 6 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions _plugins/docusaurus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def system!(*args)
system!("mkdir -p _site/vitest/reference")
system!("cp docusaurus/build/vitest/reference/index.html _site/vitest/reference")

system!("mkdir -p _site/vitest/cookbook")
system!("cp docusaurus/build/vitest/cookbook/index.html _site/vitest/cookbook")

system!("mkdir -p _site/vitest/troubleshooting")
system!("cp docusaurus/build/vitest/troubleshooting/index.html _site/vitest/troubleshooting")

Expand Down
8 changes: 8 additions & 0 deletions docusaurus/docs/cypress/cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,11 @@ You should replace `$MY_CI_BUILD_ID` with the correct environment variable provi
| Semaphore 2.0 | `SEMAPHORE_WORKFLOW_ID` |
| Travis | `TRAVIS_BUILD_ID` |
| Codefresh.io | `CF_BUILD_ID` |

## Run a subset of tests

To run a subset of your test suite you can use the `KNAPSACK_PRO_TEST_FILE_*` environment variables:

- [`KNAPSACK_PRO_TEST_FILE_PATTERN`](reference.md#knapsack_pro_test_file_pattern)
- [`KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN`](reference.md#knapsack_pro_test_file_exclude_pattern)
- [`KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE`](reference.md#knapsack_pro_test_file_list_source_file)
8 changes: 8 additions & 0 deletions docusaurus/docs/jest/cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,11 @@ npx knapsack-pro-jest --ci --reporters=jest-junit
```

Knapsack Pro will generate one XML reports for each batch of tests executed on the CI node. Some CI providers (e.g., GitLab CI) can merge multiple XML files from parallel CI nodes.

## Run a subset of tests

To run a subset of your test suite you can use the `KNAPSACK_PRO_TEST_FILE_*` environment variables:

- [`KNAPSACK_PRO_TEST_FILE_PATTERN`](reference.md#knapsack_pro_test_file_pattern)
- [`KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN`](reference.md#knapsack_pro_test_file_exclude_pattern)
- [`KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE`](reference.md#knapsack_pro_test_file_list_source_file)
8 changes: 6 additions & 2 deletions docusaurus/docs/ruby/rspec.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ bundle exec rake "knapsack_pro:queue:rspec[--fail-fast 3]"

To run a subset of your test suite you have a couple of options:

- `KNAPSACK_PRO_TEST_FILE_*` [environment variables](reference.md) (recommended)
- RSpec's `--tag MY_TAG`, `--tag ~MY_TAG`, `--tag type:feature`, or `--tag ~type:feature`
- `KNAPSACK_PRO_TEST_FILE_*` environment variables (recommended):
- [`KNAPSACK_PRO_TEST_FILE_PATTERN`](reference.md#knapsack_pro_test_file_pattern)
- [`KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN`](reference.md#knapsack_pro_test_file_exclude_pattern)
- [`KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE`](reference.md#knapsack_pro_test_file_list_source_file)
- [`KNAPSACK_PRO_TEST_FILE_LIST`](reference.md#knapsack_pro_test_file_list)
- RSpec's `--tag MY_TAG`, `--tag ~MY_TAG`, `--tag type:feature`, or `--tag ~type:feature`. See how to [pass command-line arguments](reference.md#command-line-arguments) here.

If you are seeking faster performance on your CI, you may want to read [Parallelize test examples (instead of files)](#parallelize-test-examples-instead-of-files)

Expand Down
14 changes: 14 additions & 0 deletions docusaurus/docs/vitest/cookbook.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
pagination_next: null
pagination_prev: null
---

# Vitest Cookbook

## Run a subset of tests

To run a subset of your test suite you can use the `KNAPSACK_PRO_TEST_FILE_*` environment variables:

- [`KNAPSACK_PRO_TEST_FILE_PATTERN`](reference.md#knapsack_pro_test_file_pattern)
- [`KNAPSACK_PRO_TEST_FILE_EXCLUDE_PATTERN`](reference.md#knapsack_pro_test_file_exclude_pattern)
- [`KNAPSACK_PRO_TEST_FILE_LIST_SOURCE_FILE`](reference.md#knapsack_pro_test_file_list_source_file)
5 changes: 5 additions & 0 deletions docusaurus/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,11 @@ const sidebars: SidebarsConfig = {
label: "Troubleshooting",
id: "vitest/troubleshooting",
},
{
type: "doc",
label: "Cookbook",
id: "vitest/cookbook",
},
{
type: "link",
label: "GitHub",
Expand Down
Loading