Git Product home page Git Product logo

vscode-reacttestgen's Introduction

ReactComponent TestCase Generator for Visual Studio Code

Install the extension on the VSCode Marketplace

Requirements

  • node-plop = ^0.26.2
  • plop = ^2.7.4
  • node = ^14.14.27
  • vscode = ^1.53.0

For Developement Environment Clone this Repo, npm i & F5

Features

  • This extension adds single and multi-file templates to Visual Studio Code. Add a template by right clicking the desired location and selecting Generate ReactComponent TestCase

  • Generates plofile.js (you can modify anytime according to your need)

  • Generates /plop-templates directory with test.js.hbs (contains React Component Test Template) in your VSCode workspace

  • Generates /__test__ inside src folder to allow npm run test to test all your generated test cases

Creating new project item from template

To invoke template selection, simply right click on a folder or file in vscode file explorer and click the Generate ReactComponent TestCase menu item.

Click it twice if required direcotries does not exists

Extension Setup

  1. Install the VSCode extension
  2. Install plop.js globally using sudo npm i -g plop

ProTip: Add plop templates as a recommended extension to your Workspace or Project settings file and commit it. Then everyone on your team will see this extension

Release Notes

1.0.0

  • Initial release
  • Generates Basic Sanity Check Test Cases for React Component

vscode-reacttestgen's People

Contributors

therakeshpurohit avatar imgbotapp avatar

Stargazers

 avatar

Watchers

 avatar

vscode-reacttestgen's Issues

Error: Cannot find module 'node-plop'

2023-02-15 10:50:29.519 [info] ExtensionService#_doActivateExtension TheRakeshPurohit.reacttestgen, startup: false, activationEvent: 'onCommand:ploptemplates.newFile'
2023-02-15 10:50:29.522 [error] Activating extension TheRakeshPurohit.reacttestgen failed due to an error:
2023-02-15 10:50:29.522 [error] Error: Cannot find module 'node-plop'

The readme says nothing about installing 'node-plop', and installing it globally doesn't seem to help.

I tried installing it globally...

> npm ls -g node-plop plop
C:\Users\$USERNAME\AppData\Roaming\npm
+-- [email protected]
`-- [email protected]
  `-- [email protected]

And locally, and it still does not seem to find it:

├── [email protected]
└─┬ [email protected]
  └── [email protected] deduped

Version: 1.75.1 (user setup)
Commit: 441438abd1ac652551dbe4d408dfcec8a499b8bf
Date: 2023-02-08T21:32:34.589Z
Electron: 19.1.9
Chromium: 102.0.5005.194
Node.js: 16.14.2
V8: 10.2.154.23-electron.0
OS: Windows_NT x64 10.0.19045
Sandboxed: No

Require stack:

  • c:\Users$USERNAME.vscode\extensions\therakeshpurohit.reacttestgen-1.3.10\dist\extension.js
  • c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js
  • c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-amd.js
  • c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js
  • at Module._resolveFilename (node:internal/modules/cjs/loader:987:15)
    at i._resolveFilename (node:electron/js2c/utility_init:17:840)
    at Module._load (node:internal/modules/cjs/loader:832:27)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at r._load (c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:122:13360)
    at g._load (c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:117:62400)
    at E._load (c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:117:61793)
    at Module.require (node:internal/modules/cjs/loader:1059:19)
    at p (c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:699)
    at Object. (c:\Users$USERNAME.vscode\extensions\therakeshpurohit.reacttestgen-1.3.10\dist\extension.js:1:1143)
    at n (c:\Users$USERNAME.vscode\extensions\therakeshpurohit.reacttestgen-1.3.10\dist\extension.js:1:186)
    at Module. (c:\Users$USERNAME.vscode\extensions\therakeshpurohit.reacttestgen-1.3.10\dist\extension.js:1:1312)
    at n (c:\Users$USERNAME.vscode\extensions\therakeshpurohit.reacttestgen-1.3.10\dist\extension.js:1:186)
    at c:\Users$USERNAME.vscode\extensions\therakeshpurohit.reacttestgen-1.3.10\dist\extension.js:1:985
    at Object. (c:\Users$USERNAME.vscode\extensions\therakeshpurohit.reacttestgen-1.3.10\dist\extension.js:1:994)
    at u._compile (c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:4:1313)
    at Module._extensions..js (node:internal/modules/cjs/loader:1220:10)
    at Module.load (node:internal/modules/cjs/loader:1035:32)
    at Module._load (node:internal/modules/cjs/loader:876:12)
    at c._load (node:electron/js2c/asar_bundle:5:13343)
    at r._load (c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:122:13360)
    at g._load (c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:117:62400)
    at E._load (c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:117:61793)
    at Module.require (node:internal/modules/cjs/loader:1059:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Function.r [as __$__nodeRequire] (c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js:5:101)
    at f.pb (c:\Users$USERNAME\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\api\node\extensionHostProcess.js:117:63664)
    at async Promise.all (index 0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.