Skip to content

Commit

Permalink
chore(docs): add example usage
Browse files Browse the repository at this point in the history
  • Loading branch information
nikovirtala committed Dec 29, 2024
1 parent 9953401 commit 7790fff
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
# projen vitest

[Vitest](https://vitest.dev) component for [projen](https://projen.io) [Node.js](https://nodejs.org/en) projects.

## example usage

- in `.projenrc.ts` import `Vitest` component and create new instance of it:

```ts
import { awscdk, javascript } from "projen";
import { Vitest } from "@nikovirtala/projen-vitest";

const project = new awscdk.AwsCdkTypeScriptApp({
defaultReleaseBranch: "main",
devDeps: ["@nikovirtala/projen-vitest"],
jest: false,
name: "vitest-example",
projenrcTs: true,
});

new Vitest(project);

project.synth();
```

- in `*.test.ts` import necessary modules from `vitest`:

```ts
import { describe, expect, test } from "vitest";
```

- run tests with `pj test`

0 comments on commit 7790fff

Please sign in to comment.