module.exports = (grunt) ->
+ grunt.loadNpmTasks('grunt-karma');
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
]
+ karma:
+ unit:
+ configFile: 'karma.conf.js'
+ singleRun: true
+
+
watch:
options:
spawn: false
config.set({
// base path, that will be used to resolve files and exclude
- basePath: 'src/main/webapp/javascripts',
+ basePath: 'src/main/webapp/js',
// frameworks to use
// dependencies
'third-party/jquery.js',
'third-party/underscore.js',
- 'third-party/require.js',
+ 'require.js',
'translate.js',
'common/inputs.js',
coverageReporter: {
- type : 'text',
+ type : 'lcovonly',
dir : '../../../../target/karma/coverage/'
},
"grunt-contrib-handlebars": "^0.7.0",
"grunt-contrib-requirejs": "^0.4.3",
"grunt-contrib-watch": "~0.5.3",
- "grunt-contrib-uglify": "^0.4.0"
+ "grunt-contrib-uglify": "^0.4.0",
+ "grunt-karma": "~0.6.2"
},
"engines": {
"node": "~0.8 || ~0.10"
},
- "scripts": {
- "test": "./node_modules/.bin/karma start --single-run"
- },
"assets": "src/main/webapp/"
}
<arguments>install</arguments>
</configuration>
</execution>
+ <execution>
+ <id>javascript tests</id>
+ <phase>test</phase>
+ <goals>
+ <goal>grunt</goal>
+ </goals>
+ <configuration>
+ <arguments>karma</arguments>
+ </configuration>
+ </execution>
<execution>
<phase>generate-resources</phase>
<id>grunt build</id>