A "spec" grunt task for Jasmine that includes a standard pack of helpers (jasmine-given, jasmine-stealth, jasmine-only). Uses minijasminenode.
CoffeeScript JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
lib
tasks
.gitignore
.npmignore
.travis.yml
README.md
index.js
package.json
task-generator.js

README.md

grunt-jasmine-bundle

Build Status

An opinionated little grunt task for running Jasmine specs of JavaScript/CoffeeScript written to run under Node.js.

It delegates to minijasminenode and includes the following goodies without you even asking:

Usage

Check out the included example project for a minimal realistic usage.

Options

  • helpers - a path, glob string, or array of paths and glob strings to all of your spec helpers in the build. These will be loaded prior to your specs (default is "spec/helpers/**/*.{js,coffee}").
  • specs - a path, glob string, or array of paths and glob strings to all of your specs themselves (default is "spec/**/*.{js,coffee}").
  • minijasminenode - a configuration object that will be passed to minijasminenode in accordance to whatever options it accepts.

No configuration is necessary if the defaults work for you. A simple config might be as small as this, however:

grunt.loadNpmTasks("grunt-jasmine-bundle")

grunt.initConfig({
  spec: {
    unit: {
      options: {
        minijasminenode: {
          showColors: true
        }
      }
    }
  }
});

Multiple builds

grunt-jasmine-bundle is a multi-task, which means that, if you choose, you can set up multiple builds via configuration. Something like this ought to work:

grunt.initConfig({
  spec: {
    options: {
      minijasminenode: {
        showColors: true
      }
    },
    unit: {
      options: {
        helpers: ["shared/helpers/**/*.{js,coffee}", "test/helpers/**/*.{js,coffee}"],
        specs: "test/**/*.{js,coffee}"
      }
    },
    e2e: {
      options: {
        helpers: ["shared/helpers/**/*.{js,coffee}", "e2e/helpers/**/*.{js,coffee}"],
        specs: "e2e/**/*.{js,coffee}"
      }
    }
  }
});