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

gruntacular

v0.3.0

Published

grunt plugin for testacular

Downloads

16

Readme

#gruntacular Grunt plugin for Testacular NOTE: this plugin requires Grunt 0.4.x

##Getting Started From the same directory as your project's Gruntfile and package.json, install this plugin with the following command:

npm install gruntacular --save-dev

Once that's done, add this line to your project's Gruntfile:

grunt.loadNpmTasks('gruntacular');

##Config Inside your Gruntfile.js file, add a section named testacular, containing any number of configurations for running testacular. The only required option is the path to the testacular config file. Here's a simple example:

testacular: {
  unit: {
    configFile: 'testacular.conf.js'
  }
}

You can override any of the config file's settings directly:

testacular: {
  unit: {
    configFile: 'testacular.conf.js',
    runnerPort: 9999,
    singleRun: true,
    browsers: ['PhantomJS']
  }
}

##Running tests There are three ways to run your tests with testacular:

###Testacular Server with Auto Runs on File Change Setting the autoWatch option to true will instruct testacular to start a server and watch for changes to files, running tests automatically:

testacular: {
  unit: {
    configFile: 'testacular.conf.js',
    autoWatch: true
  }
}

Now run $ grunt testacular

However, usually Grunt projects watch many types of files using grunt-contrib-watch, so this option isn't preferred.

###Testacular Server with Grunt Watch Config testacular like usual (without the autoWatch option):

testacular: {
  unit: {
    configFile: 'testacular.conf.js'
  }
}

Config your watch task to run the testacular task with the :run flag. For example:

watch: {
  //run unit tests with testacular (server needs to be already running)
  testacular: {
    files: ['app/js/**/*.js', 'test/browser/**/*.js'],
    tasks: ['testacular:unit:run'] //NOTE the :run flag
  }
},

In one terminal window start the testacular server by running $ grunt testacular. In another terminal window start grunt watch by running $ grunt watch. Now when grunt watch detects a change to one of those files, it will run the testacular tests using the already running testacular server. This is the preferred method for development.

###Single Run Keeping a browser window & testacular server running during development is productive, but not a good solution for build processes. For that reason testacular provides a "continuous integration" mode, which will launch the specified browser(s), run the tests, and close the browser(s). It also supports running tests in PhantomJS, a headless webkit browser which is great for running tests as part of a build. To run tests in continous integration mode just add the singleRun option:

testacular: {
  unit: {
    configFile: 'config/testacular.conf.js',
  },
  //continuous integration mode: run tests once in PhantomJS browser.
  continuous: {
    configFile: 'config/testacular.conf.js',
    singleRun: true,
    browsers: ['PhantomJS']
  },
}

The build would then run grunt testacular:continuous to start PhantomJS, run tests, and close PhantomJS.

##License MIT License