Vitest component for projen Node.js projects.
- in
.projenrc.ts
importVitest
component and create new instance of it:
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 fromvitest
:
import { describe, expect, test } from "vitest";
- run tests with
pj test