testdouble / grunt-jasmine-bundle

A "spec" grunt task for Jasmine that includes a standard pack of helpers (jasmine-given, jasmine-stealth, jasmine-only). Uses minijasminenode.
6 stars 4 forks source link

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

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}"
      }
    }
  }
});