New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

generator-yosapy

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-yosapy

Generates Jasmine test for your angularJs file, Most of these auto generated custom test cases will actually be passing and it will take file’s code coverage from 0% to 40%-50% without writing a single line of code, ain't that freaking awesome!!!

latest
Source
npmnpm
Version
0.0.9
Version published
Maintainers
1
Created
Source

yoSapy Build Status Code Climate Test Coverage Dependency Status

AngularJS test generator. It's an yeoman generator. Generates customized Jasmine test for your angularJs file [Right now only works for controllers . test generator for directives and services are under construction...]

  • Takes path of the angularJs file to be tested as input.
  • Parses the file and generates a test file.
  • Be ready for surprise - you will be amazed to see that most of these auto generated test are actually passing , and you need to edit rest, to make them pass (Obviously ).
  • this auto generated test file takes your code coverage for that file from 0% to 40-50% without writing a single line of code . Now that's Freaking awesome!!!

Usage

globally install the module

npm install -g generator-yosapy
  • Now go to the test folder in your Angular project, where you want the test file to be created.
cd ~/path/To/Your/Test/Folder/
  • Now run following command. ( It's a yeoman generator so you need to have yeoman installed)
yo yosapy
  • It will prompt you for the path of the file to be tested. Provide absolute path of the file.
?Absolute path of the File to be tested: absolutePath/of/file/myController.js
  • This generator will parse your file and genearte a test file for you .

Caveat

This generators parses your file using and Esprima and Regex, and to produce meaningful, mostly passing , custom testcases , I had to make a hell lot of assumptions and even hell lot more fallBacks. here are some tips to help the generator not to fail with weired error messages for your input file.

  • Only tested this on Mac . Might fail for other Operatiing System (specially windows)
  • Please ensure your input file is not having syntactical error (e.g passes JSLint)
  • Your input file should contain a single component (It should not have more than one controlers or directive clubbed in a single file.)

Support

This generator not working at all ? or generating gibberish ? then Probably the some of my "assumptions" (to be specific regex and ast-queries) need to be refined . Feel free to shoot a mail at saptarshichatterjee1@gmail.com with input.js file and I will be happy to help .

Keywords

yeoman-generator

FAQs

Package last updated on 12 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts