forked from compiler-explorer/compiler-explorer
-
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.
Merge branch 'compiler-explorer:main' into substring
- Loading branch information
Showing
86 changed files
with
5,577 additions
and
7,091 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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,19 @@ | ||
## `vitest` crib sheet | ||
|
||
We just moved to a new testing framework, `vitest`. Here are some notes to help you get started. | ||
|
||
### Running tests | ||
|
||
- `npm test` will run the tests | ||
- `npm run test:watch` will run the watcher; which runs all the tests and then watches for changes and then runs on the | ||
changed tests. This is much quicker as a lot of the work is cached. | ||
- `npm run test:watch <path>` will do the same with just a path | ||
|
||
### Writing tests | ||
|
||
In general use `describe`, `it` and `expect` as you would with jest. Import these all from `vitest`. If you need async | ||
things then use `await expect(someAsyncThing()).resolves.toEqual(someValue)`. | ||
|
||
The `expect` is pretty rich and supports a lot of matchers, like `expect(x).toContain("moo")` or | ||
`expect(y).not.toHaveProperty("badger")`. You can see the full list in the | ||
[vitest documentation](https://vitest.dev/api/expect.html). |
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
Oops, something went wrong.