Skip to content

Commit

Permalink
Document Vitest (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
3v0k4 authored Dec 30, 2024
1 parent 295d6d7 commit fd00dd9
Show file tree
Hide file tree
Showing 20 changed files with 1,140 additions and 53 deletions.
20 changes: 9 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ GEM
public_suffix (>= 2.0.2, < 7.0)
bigdecimal (3.1.8)
colorator (1.1.0)
concurrent-ruby (1.3.3)
concurrent-ruby (1.3.4)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.17.0)
forwardable-extended (2.6.0)
google-protobuf (4.27.2)
google-protobuf (4.27.5)
bigdecimal
rake (>= 13)
http_parser.rb (0.8.0)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
jekyll (4.3.3)
jekyll (4.3.4)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
Expand Down Expand Up @@ -51,23 +51,21 @@ GEM
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (6.0.0)
public_suffix (6.0.1)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.3.1)
strscan
rexml (3.3.9)
rouge (4.3.0)
safe_yaml (1.0.5)
sass-embedded (1.77.5)
google-protobuf (>= 3.25, < 5.0)
sass-embedded (1.77.8)
google-protobuf (~> 4.26)
rake (>= 13)
strscan (3.1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.5.0)
webrick (1.8.1)
webrick (1.8.2)

PLATFORMS
ruby
Expand Down
9 changes: 9 additions & 0 deletions _plugins/docusaurus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ def system!(*args)
system!("mkdir -p _site/jest/troubleshooting")
system!("cp docusaurus/build/jest/troubleshooting/index.html _site/jest/troubleshooting")

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

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

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

system!("mkdir -p _site/integration")
system!("cp docusaurus/build/integration/index.html _site/integration") # redirect to /
system!("cp docusaurus/build/index.html _site")
Expand Down
4 changes: 2 additions & 2 deletions docusaurus/docs/cypress/guide/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,10 @@ jobs:
# highlight-end
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
Expand Down
18 changes: 8 additions & 10 deletions docusaurus/docs/cypress/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ Available: anything that [node-glob](https://github.com/isaacs/node-glob#glob-pr
Hint: you can debug in `node`

```js
var glob = require("glob");
var MY_GLOB = "cypress/e2e/admin/**/*.{js,jsx}";
glob(MY_GLOB, {}, function (err, files) {
console.log(files);
});
const { globSync } = require("glob");
const MY_GLOB = "cypress/e2e/admin/**/*.{js,jsx}";
const files = globSync(MY_GLOB);
console.log(files);
```

Examples:
Expand Down Expand Up @@ -199,11 +198,10 @@ Available: anything that [node-glob](https://github.com/isaacs/node-glob#glob-pr
Hint: you can debug in `node`

```js
var glob = require("glob");
var MY_GLOB = "cypress/e2e/**/*.{js,jsx,coffee,cjsx}";
glob(MY_GLOB, {}, function (err, files) {
console.log(files);
});
const { globSync } = require("glob");
const MY_GLOB = "cypress/e2e/**/*.{js,jsx,coffee,cjsx}";
const files = globSync(MY_GLOB);
console.log(files);
```

Examples:
Expand Down
2 changes: 0 additions & 2 deletions docusaurus/docs/cypress/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ You can increase the memory available to Node with [`--max_old_space_size`](http
```bash
export NODE_OPTIONS=--max_old_space_size=4096

npx knapsack-pro-jest

npx knapsack-pro-cypress
```

Expand Down
18 changes: 12 additions & 6 deletions docusaurus/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ pagination_next: overview/index

import api from "@site/static/img/api.png";
import javascript from "@site/static/img/javascript.png"
import Vitest from "@site/static/img/vitest.svg"
import jest from "@site/static/img/jest.jpg"
import cypress from "@site/static/img/cypress.jpg"
import ruby from "@site/static/img/ruby.png"
Expand All @@ -20,15 +21,15 @@ If you have questions, feel free to [contact us](https://knapsackpro.com/contact
## Overview

<div className="grid">
<a href="/overview/" className="cell">
<div className="cell__image"><img width="70" height="70" src={knapsack}></img></div>
<a href="/overview/" className="cell cell--fixed">
<span className="cell__image"><img width="70" height="70" src={knapsack}></img></span>
<h2 className="cell__title">Knapsack Overview</h2>
</a>
</div>

## Libraries

<div className="grid">
<div className="grid-4">
<a href="/knapsack_pro-ruby/guide/" className="cell">
<div className="cell__image cell__image--ruby"><img width="60" height="60" src={ruby}></img></div>
<h2 className="cell__title">Ruby</h2>
Expand All @@ -43,6 +44,11 @@ If you have questions, feel free to [contact us](https://knapsackpro.com/contact
<div className="cell__image"><img width="70" height="70" src={jest}></img></div>
<h2 className="cell__title">Jest</h2>
</a>

<a href="/vitest/guide/" className="cell">
<div className="cell__image"><Vitest className="w-full h-auto center" /></div>
<h2 className="cell__title">Vitest</h2>
</a>
</div>

Can't see your language/testing framework above? [Let us know](https://docs.google.com/forms/d/e/1FAIpQLSe7Z6k__VczmRMmXykjA5i2MVEA3nEJ90gbiIeCRjecWhPOig/viewform?hl=en).
Expand All @@ -52,12 +58,12 @@ Can't see your language/testing framework above? [Let us know](https://docs.goog
You can still use Knapsack Pro by writing your integration on top of the JavaScript SDK or using the Knapsack Pro API:

<div className="grid">
<a href="https://docs.knapsackpro.com/2020/how-to-build-native-integration-with-knapsack-pro-api-to-run-tests-in-parallel-for-any-test-runner-testing-framework" target="_blank" rel="noopener noreferrer" className="cell">
<a href="https://docs.knapsackpro.com/2020/how-to-build-native-integration-with-knapsack-pro-api-to-run-tests-in-parallel-for-any-test-runner-testing-framework" target="_blank" rel="noopener noreferrer" className="cell cell--fixed">
<div className="cell__image"><img width="70" height="70" src={javascript}></img></div>
<h2 className="cell__title">JavaScript / TypeScript</h2>
</a>

<a href="https://docs.knapsackpro.com/2021/how-to-build-knapsack-pro-api-client-from-scratch-in-any-programming-language" target="_blank" rel="noopener noreferrer" className="cell">
<a href="https://docs.knapsackpro.com/2021/how-to-build-knapsack-pro-api-client-from-scratch-in-any-programming-language" target="_blank" rel="noopener noreferrer" className="cell cell--fixed">
<div className="cell__image"><img width="70" height="70" src={api}></img></div>
<h2 className="cell__title">Other Language</h2>
</a>
Expand All @@ -66,7 +72,7 @@ You can still use Knapsack Pro by writing your integration on top of the JavaScr
## Troubleshooting

<div className="grid">
<a href="/troubleshooting/" className="cell" style={{width: 'auto'}}>
<a href="/troubleshooting/" className="cell cell--fixed" style={{width: 'auto'}}>
<div className="cell__image"><img width="70" height="70" src={troubleshooting}></img></div>
<h2 className="cell__title">Troubleshooting</h2>
</a>
Expand Down
4 changes: 2 additions & 2 deletions docusaurus/docs/jest/guide/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,10 @@ jobs:
# highlight-end
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
Expand Down
18 changes: 8 additions & 10 deletions docusaurus/docs/jest/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,10 @@ Available: anything that [node-glob](https://github.com/isaacs/node-glob#glob-pr
Hint: you can debug in `node`

```js
var glob = require("glob");
var MY_GLOB = "{**/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x)}";
glob(MY_GLOB, {}, function (err, files) {
console.log(files);
});
const { globSync } = require("glob");
const MY_GLOB = "{**/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x)}";
const files = globSync(MY_GLOB);
console.log(files);
```

Examples:
Expand Down Expand Up @@ -207,11 +206,10 @@ Available: anything that [node-glob](https://github.com/isaacs/node-glob#glob-pr
Hint: you can debug in `node`

```js
var glob = require("glob");
var MY_GLOB = "{**/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x)}";
glob(MY_GLOB, {}, function (err, files) {
console.log(files);
});
const { globSync } = require("glob");
const MY_GLOB = "{**/__tests__/**/*.js?(x),**/?(*.)(spec|test).js?(x)}";
const files = globSync(MY_GLOB);
console.log(files);
```

Examples:
Expand Down
2 changes: 0 additions & 2 deletions docusaurus/docs/jest/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ You can increase the memory available to Node with [`--max_old_space_size`](http
export NODE_OPTIONS=--max_old_space_size=4096

npx knapsack-pro-jest

npx knapsack-pro-cypress
```

## Debug Knapsack Pro on your development environment/machine
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/knapsack_pro-ruby/guide/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ jobs:
TZ: "Europe/Warsaw"

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand Down
2 changes: 1 addition & 1 deletion docusaurus/docs/overview/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Knapsack Pro wraps your current test runner(s) and works with your existing CI i
- Tracks your CI builds to detect bottlenecks
- Does not have access to your source code and collects minimal test data (with opt-in encryption)
- Enables you to export historical metrics about your CI builds
- Supports out-of-the-box any Ruby test runners, Cypress, Jest (and provides both SDK and API to integrate with any other language)
- Supports out-of-the-box any Ruby test runners, Cypress, Jest, Vitest (and provides both SDK and API to integrate with any other language)
- Replaces local dependencies like Redis with an API and runs your tests regardless of network problems

<Architecture className="w-full h-auto center" />
Expand Down
8 changes: 7 additions & 1 deletion docusaurus/docs/troubleshooting/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ pagination_next: null
import ruby from "@site/static/img/ruby.png"
import cypress from "@site/static/img/cypress.jpg"
import jest from "@site/static/img/jest.jpg"
import Vitest from "@site/static/img/vitest.svg"

# Troubleshooting

Expand All @@ -15,7 +16,7 @@ If you are utilizing two CI providers simultaneously, for example, CircleCI and

## Troubleshooting libraries

<div className="grid">
<div className="grid-4">
<a href="/ruby/troubleshooting/" className="cell">
<div className="cell__image cell__image--ruby"><img width="60" height="60" src={ruby}></img></div>
<h2 className="cell__title">Ruby</h2>
Expand All @@ -30,4 +31,9 @@ If you are utilizing two CI providers simultaneously, for example, CircleCI and
<div className="cell__image"><img width="70" height="70" src={jest}></img></div>
<h2 className="cell__title">Jest</h2>
</a>

<a href="/vitest/troubleshooting/" className="cell">
<div className="cell__image"><Vitest className="w-full h-auto center" /></div>
<h2 className="cell__title">Vitest</h2>
</a>
</div>
Loading

0 comments on commit fd00dd9

Please sign in to comment.