npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-yosapy

v0.0.9

Published

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!!!

Downloads

29

Readme

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...]

  • [x] Takes path of the angularJs file to be tested as input.
  • [x] Parses the file and generates a test file.
  • [x] 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 ).
  • [x] 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
  1. 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/
  1. Now run following command. ( It's a yeoman generator so you need to have yeoman installed)
yo yosapy
  1. 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
  1. 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.

  • [x] Only tested this on Mac . Might fail for other Operatiing System (specially windows)
  • [x] Please ensure your input file is not having syntactical error (e.g passes JSLint)
  • [x] 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 [email protected] with input.js file and I will be happy to help .