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

karma-angular

v0.0.6

Published

Simplifies getting angular tests running on karma

Downloads

11,795

Readme

karma-angular

Build Status Coverage Status

The Angular team is now reliably releasing all of the angular modules via npm. Typically you'd need to add a bunch of boiler plate referencing those paths, and make sure they are included in the right order.

No longer! Just install this framework and it will scan your package.json, find all your angular dependencies, and make sure they are being served up by karma.

As an added bonus: If you decide to add/remove an angular module later, just npm install --save or npm remove --save it. Your karma config does not need to change.

Note: This is only works for official angular modules released by the Angular team

Install karma-angular

npm install --save-dev karma-angular

Install desired angular-dependencies via npm

npm install --save-dev angular-mocks
npm install --save angular angular-route

Set Up Your karma.conf.js

module.exports = function(karma){
  karma.set({
    // register the framework (it needs to go before mocha / jasmine)
    frameworks: ['angular', 'mocha'],


    files: [               // no need to enter paths for angular / angular-mocks
      "src/**.js",         // your package.json is scanned and they will be automatically
      "test/**-test.js"    // prepended to this array.
    ],

    browsers: ['PhantomJS']
  });
};

If the automatic scanning is not working for you, you can force which modules are included with an array of strings as shown below. This really is not recommended, as it's not really saving you any work (just use the files array at this point) and you lose out on managing those dependencies entirely from npm install / remove. Provided mostly as a way for you to hot-fix if angular releases a new module you need right now and I have not white listed it yet. If that is the case, please create an issue, or better yet write up a quick Pull Request on the white-list in this file.

module.exports = function(karma){
 karma.set({
   frameworks: ['angular', 'mocha'],

   // you can use the full name (i.e. 'angular-mocks', or just shorten it to 'mocks')
   angular: ['mocks', 'route', 'angular-aria'],

   files: [
     "src/**.js",
     "test/**-test.js"
   ],

   browsers: ['PhantomJS']
 });
};

If for some reason you need further examples, one can be found here.