@apitree.cz/testing-library v0.3.0
Testing Library
React Testing Library setup for Vitest in ApiTree projects.
Installation
pnpm add --save-dev @apitree.cz/testing-library @testing-library/react vitest
Usage
Setup Vitest for React with
@apitree.cz/vitest-config
.Create
tests/setup.ts
:import '@apitree.cz/testing-library/setup';
Create test renderers in
tests/testing-library.ts
import { createRenderers } from '@apitree.cz/testing-library'; export * from '@apitree.cz/testing-library'; export * from '@testing-library/react'; export const { render, renderHook } = createRenderers();
See
CreateRenderersProps
forcreateRenderers
props reference.Write your tests in
tests
directory and run them withvitest --run
command.Use
tests/testing-library.ts
for importing Testing Library utilities.
11 months ago
11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago