UNPKG

1.96 kBJavaScriptView Raw
1/*global module:false*/
2module.exports = function(grunt) {
3
4 // Project configuration.
5 grunt.initConfig({
6 mochaTest: {
7 test: {
8 options: {
9 reporter: 'spec',
10 captureFile: 'results.txt', // Optionally capture the reporter output to a file
11 quiet: false, // Optionally suppress output to standard out (defaults to false)
12 clearRequireCache: false // Optionally clear the require cache before running tests (defaults to false)
13 },
14 src: ['test/**/*.js','test/app/helpers/visualizations/*.js']
15 }
16 },
17 vagrantup: {
18 testing: {
19 options: {
20 keepalive: false,
21 setup: ['mochaTest'],
22 teardown: []
23 }
24 }
25 },
26 jshint: {
27 options: {
28 curly: true,
29 eqeqeq: true,
30 immed: true,
31 latedef: true,
32 newcap: true,
33 noarg: true,
34 sub: true,
35 undef: true,
36 unused: true,
37 boss: true,
38 eqnull: true,
39 browser: true,
40 globals: {
41 jQuery: true
42 }
43 },
44 gruntfile: {
45 src: 'Gruntfile.js'
46 },
47 lib_test: {
48 src: ['lib/**/*.js', 'test/**/*.js']
49 }
50 },
51 qunit: {
52 files: ['test/**/*.html']
53 },
54 watch: {
55 gruntfile: {
56 files: '<%= jshint.gruntfile.src %>',
57 tasks: ['jshint:gruntfile']
58 },
59 lib_test: {
60 files: '<%= jshint.lib_test.src %>',
61 tasks: ['jshint:lib_test', 'qunit']
62 }
63 }
64 });
65
66 // These plugins provide necessary tasks.
67 grunt.loadNpmTasks('grunt-contrib-qunit');
68 grunt.loadNpmTasks('grunt-contrib-jshint');
69 grunt.loadNpmTasks('grunt-contrib-watch');
70 grunt.loadNpmTasks('grunt-vagrantup');
71 grunt.loadNpmTasks('grunt-mocha-test');
72
73 // Default task.
74 grunt.registerTask('default', ['jshint', 'qunit']);
75 grunt.registerTask('vagrant', ['vagrantup']);
76 grunt.registerTask('test', ['mochaTest']);
77
78};