Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Test GeneratorNew to Visual Studio Code? Get it now.
Test Generator

Test Generator

Joel Podrebarac

|
609 installs
| (0) | Free
Generate test files in directories
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Test Generator

Generate test files and directories

Screenshot

Configuration

Testing Directory

Ex. File needing to be tested at ./src/index.tsx

{
    "test-generator.sourceRoot": "./src", // Sets the file root source to './src'
    "test-generator.testDirectory": "__tests__", // Outputs the test file in "__tests__/index.spec.tsx",
    "test-generator.fileSuffix": "test", // Outputs the file to "__tests__/index.test.tsx"
    "test-generator.noTestDirectory": true, // Outputs the file to "./src/index.test.tsx",
    "test-generator.testSnippet": [
        "describe('${1:Component}', () => {",
        "})"
    ] // Renders a snippet in the newly created test file. see https://code.visualstudio.com/docs/editor/userdefinedsnippets for documentation on UserSnippets
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft