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