grunt-contrib-jasmine/docs/jasmine-examples.md

66 lines
1.3 KiB
Markdown
Raw Normal View History

## Example application usage
- [Pivotal Labs' sample application](https://github.com/jsoverson/grunt-contrib-jasmine-example)
2012-11-02 13:03:09 +08:00
## Basic Use
Sample configuration to run Pivotal Labs' example Jasmine application.
```js
// Example configuration
grunt.initConfig({
jasmine: {
pivotal: {
src: 'src/**/*.js',
options: {
specs: 'spec/*Spec.js',
helpers: 'spec/*Helper.js'
}
}
}
});
```
## Supplying a custom template
Supplying a custom template to the above example
```js
// Example configuration
grunt.initConfig({
jasmine: {
customTemplate: {
src: 'src/**/*.js',
options: {
specs: 'spec/*Spec.js',
helpers: 'spec/*Helper.js',
template: 'custom.tmpl'
}
}
}
});
```
2013-01-10 13:14:50 +08:00
## Sample RequireJS/NPM Template usage
2013-01-10 13:14:50 +08:00
```js
// Example configuration
grunt.initConfig({
jasmine: {
yourTask: {
src: 'src/**/*.js',
options: {
specs: 'spec/*Spec.js',
template: require('grunt-template-jasmine-requirejs')
}
}
}
});
2013-01-10 13:14:50 +08:00
```
NPM Templates are just node modules, so you can write and treat them as such.
Please see the [grunt-template-jasmine-requirejs](https://github.com/jsoverson/grunt-template-jasmine-requirejs) documentation
for more information on the RequireJS template.