2013-06-16 02:15:01 +08:00
|
|
|
## 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
|
2012-11-02 13:03:09 +08:00
|
|
|
|
|
|
|
Sample configuration to run Pivotal Labs' example Jasmine application.
|
|
|
|
|
|
|
|
```js
|
2012-12-03 16:17:06 +08:00
|
|
|
// Example configuration
|
|
|
|
grunt.initConfig({
|
|
|
|
jasmine: {
|
|
|
|
pivotal: {
|
2013-02-23 02:06:43 +08:00
|
|
|
src: 'src/**/*.js',
|
2012-12-03 16:17:06 +08:00
|
|
|
options: {
|
|
|
|
specs: 'spec/*Spec.js',
|
|
|
|
helpers: 'spec/*Helper.js'
|
|
|
|
}
|
2012-11-02 13:03:09 +08:00
|
|
|
}
|
|
|
|
}
|
2013-02-23 02:06:43 +08:00
|
|
|
});
|
2012-11-02 13:03:09 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
## Supplying a custom template
|
|
|
|
|
|
|
|
Supplying a custom template to the above example
|
|
|
|
|
|
|
|
```js
|
2012-12-03 16:17:06 +08:00
|
|
|
// Example configuration
|
|
|
|
grunt.initConfig({
|
|
|
|
jasmine: {
|
|
|
|
customTemplate: {
|
|
|
|
src: 'src/**/*.js',
|
|
|
|
options: {
|
|
|
|
specs: 'spec/*Spec.js',
|
2013-04-05 01:39:00 +08:00
|
|
|
helpers: 'spec/*Helper.js',
|
2012-12-03 16:17:06 +08:00
|
|
|
template: 'custom.tmpl'
|
|
|
|
}
|
2012-11-02 13:03:09 +08:00
|
|
|
}
|
|
|
|
}
|
2013-02-23 02:06:43 +08:00
|
|
|
});
|
2012-11-02 13:03:09 +08:00
|
|
|
```
|
|
|
|
|
2013-01-10 13:14:50 +08:00
|
|
|
## Sample RequireJS/NPM Template usage
|
2012-11-02 13:03:09 +08:00
|
|
|
|
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-02-23 02:06:43 +08:00
|
|
|
});
|
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.
|