JestJen is a Visual Studio Code extension that simplifies the process of generating Jest test files for JavaScript and TypeScript source files. With JestJen, you can quickly create a corresponding test file for any .js or .ts file in your project with a single command or a right-click context menu option.
Features
Generate Jest Test Files: Automatically create a Jest test file for any selected .js or .ts file in your project.
Context Menu Integration: Right-click on a file in the explorer to generate a test file.
Keyboard Shortcut: Use the Shift+Alt+T shortcut to generate a test file for the currently open file.
Conditional Generation: Ensures that test files are only generated for non-test .js and .ts files.
Usage
Right-Click Context Menu:
Right-click on any .js or .ts file in the explorer.
Select "Create Jest Test File" from the context menu.
Keyboard Shortcut:
Open any .js or .ts file.
Press Shift+Alt+T to generate a corresponding test file.
The generated test file will be placed in a test directory, maintaining the relative path structure of the source file. For example: