|
1 | | -# Vitest |
| 1 | +# Qlty Typescript NextJs Coverage Example |
2 | 2 |
|
3 | | -This example shows how to use [Vitest](https://github.com/vitest-dev/vitest) with Next.js. |
| 3 | +[Qlty](https://example.com) is a Code Health Platform with support for code coverage. |
4 | 4 |
|
5 | | -This includes Next.js' built-in support for Global CSS, CSS Modules and TypeScript. This example also shows how to use Vitest with the App Router and React Server Components. |
| 5 | +This repository is an example using Qlty to track code coverage for a Typescript NextJs project. Coverage data is generated during test suite run and then uploaded to Qlty. |
6 | 6 |
|
7 | | -> **Note:** Since tests can be co-located alongside other files inside the App Router, we have placed those tests in `app/` to demonstrate this behavior (which is different than `pages/`). You can still place all tests in `__tests__` if you prefer. |
| 7 | +This repository uses [vitest](https://vitest.dev/) for testing and generating coverage report. |
8 | 8 |
|
9 | | -## Deploy your own |
| 9 | +## Requirements |
10 | 10 |
|
11 | | -[](https://vercel.com/new/clone?repository-url=https://github.com/vercel/next.js/tree/canary/examples/with-vitest&project-name=with-vitest&repository-name=with-vitest) |
| 11 | +- Node 18 or above |
| 12 | +- [NextJs](https://nextjs.org/) |
| 13 | +- [Vitest](https://vitest.dev/) |
| 14 | +- Run tests with `npm test` |
| 15 | +- An account on Qlty (free for open source) |
| 16 | +- `QLTY_COVERAGE_TOKEN` is set as a GitHub Actions [repository secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) |
12 | 17 |
|
13 | | -## How to use |
| 18 | +## Set up |
14 | 19 |
|
15 | | -Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example: |
| 20 | +See [`.github/workflows/main.yml`](./.github/workflows/main.yml) in this repository for a basic configuration. |
16 | 21 |
|
17 | | -```bash |
18 | | -npx create-next-app --example with-vitest with-vitest-app |
19 | | -``` |
| 22 | +## Documentation |
20 | 23 |
|
21 | | -```bash |
22 | | -yarn create next-app --example with-vitest with-vitest-app |
23 | | -``` |
| 24 | +- [Advanced code coverage configuration](https://example.com) |
| 25 | +- [Alternative supported CI providers](https://example.com) |
24 | 26 |
|
25 | | -```bash |
26 | | -pnpm create next-app --example with-vitest with-vitest-app |
27 | | -``` |
| 27 | +## Help and feedback |
28 | 28 |
|
29 | | -Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)). |
| 29 | +Join the our [Slack Community](https://example.com) for help and to provide feedback that we'll use to improve Qlty. |
30 | 30 |
|
31 | | -## Running Tests |
| 31 | +## License |
32 | 32 |
|
33 | | -```bash |
34 | | -npm test |
35 | | -``` |
| 33 | +[MIT License](./LICENSE.md) |
0 commit comments