JC Unit test generator is a simple plugin that reads react files and generates jest unit test boilerplate files.
- After installation, right-click on a folder, or on a .ts/.tsx file.
- Click on the option "JC: Generate Unit Tests".
- Enjoy your newly generated unit test.
- TS and TSX React Hooks
- TS and TSX React Components
- Folders that contain these types of files
(Important) Best Practices
This file must obey certain conventions in order for the generator to work:
- File Name:
- File name must be in kebab case (example:
- In order to generate a React Hook template, file name must start with 'use' (example:
- Generator skips index files (
index.tsx, ...), style files (
.style. files'), and test files (
.spec. files, and any file inside
- File Contents:
- File must only contain 1 named export (excluding type exports, example:
export const MyBeatifulComponent)
- The generator automatically skips mocking
icon imports, as it considers them to not require mocking.
- Generating Unit Tests on Folders with more than 3 files will not display the vscode info/error message.
Initial release 🚀
Added documentation and added a logo.