-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
837365a
commit 1ca6a17
Showing
7 changed files
with
1,239 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Vitest Test Data | ||
|
||
This package also supports collecting the test data of projects that are using Vitest (0.x). | ||
|
||
## Usage | ||
|
||
### Basic usage | ||
|
||
#### Vitest | ||
|
||
If you use **Vitest**, you can add the following to your `vitest.config.js` file: | ||
|
||
```javascript | ||
import { VitestTestDataPlugin } from '@agoda-com/test-metrics' | ||
|
||
export default defineConfig({ | ||
..., | ||
test: { | ||
..., | ||
reporters: ['default', new VitestTestDataPlugin()], | ||
}, | ||
}) | ||
``` | ||
|
||
Don't forget to keep `'default'` reporter in the list, otherwise you won't be able to see your test result in the console. | ||
|
||
### Advanced usage | ||
|
||
As same as build time, test data collection also sends the command that you used to run the build like `yarn test` to be the custom identifier which should work in most cases in order to help you distinguish between different test configurations. | ||
|
||
However, if you would like to define your own identifier, you can do so by passing it as a parameter to the plugin. | ||
|
||
```javascript | ||
VitestTestDataPlugin(testOnlyPartA ? 'test-only-part-a' : 'test-everything'); | ||
``` |
Oops, something went wrong.