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-jasmine-test

v1.0.0

Published

Supports both JS and PHP tests.

Downloads

3

Readme

Jasmine Test Generator

Supports both JS and PHP tests.

Yeoman generator to scaffold the test folder structure for our webapps.

## Install Yeoman

  • Use npm to install Yeoman:

    npm install -g yo

Install the generator

  • Clone this directory: ensure it goes into a folder called generator-jasmine-test as Yeoman relies on the file system to find available generators. It doesn't need to be within the project that you want to use it on, in fact, it shouldn't be!

  • Install the generator's dependencies if they are not already installed. From within your new generator-jasmine-test folder:

    npm install
  • npm link the generator from inside the generator-jasmine-test directory.

    npm link

Set up project for use with Yeoman

  • Place .yo-rc.json file at the root of the project you want to test. It will need to have an empty object {} inside of it.

Create the files

  • Go into the directory of the file you want to test and do:

    yo jasmine-test file-you-want-to-test.js
    • Additionally you can be in another location within the project when you do this, as long as you pass a path to the file-you-want-to-test.js that's relative to your current location.
  • Add --config to the end of the yo command if you want a config file to be created.

Troubleshooting

We use nodenv to manage our Node.js versions. There can be a globally used version, which should be >4.0.0 as of Feb '16 (type nodenv global at the command line to check), and also versions specific to the project you are working on, which are indicated by the presence of a .node-version file in the project root and which can be verified by typing nodenv local at the command line.

  • The generator makes extensive use of Node's path.parse() method, which was added in Node version 12. The path-parse package is a polyfill for users with <v0.12 that falls back to the native method if it exists.

  • Node versions should match between where you installed the generator and the proejct. Is the generator installed on this version of Node? Type yo --help within the project to see. If it's not, go back to the generator-jasmine-test root directory, change the nodenv version to match the project's (nodenv local x.x.x) and reinstall the generator (npm i followed by npm link). It should now run.

Run the tests

Clone the project, install all the dependencies with npm install, the run npm test.

Generate coverage reports with npm run cover.