UNPKG

2.63 kBJavaScriptView Raw
1module.exports = function(grunt) {
2 var pkg = grunt.file.readJSON('package.json');
3
4 require('jit-grunt')(grunt);
5
6 grunt.initConfig({
7 pkg: pkg,
8 bower: {
9 all: {
10 rjsConfig: 'test/rjsconfig.js',
11 options: {
12 baseUrl: 'test'
13 }
14 }
15 },
16 bump: {
17 options: {
18 files: ['package.json', 'bower.json'],
19 updateConfigs: ['pkg'],
20 commit: true,
21 commitMessage: '%VERSION%',
22 commitFiles: ['package.json', 'bower.json'], // '-a' for all files
23 createTag: true,
24 tagName: 'v%VERSION%',
25 tagMessage: '%VERSION%',
26 push: false,
27 pushTo: 'upstream',
28 gitDescribeOptions: '--tags --always --abbrev=1 --dirty=-d' // options to use with '$ git describe'
29 }
30 },
31 connect: {
32 server: {
33 options: {
34 port: 9001,
35 base: '.',
36 keepalive: true
37 }
38 }
39 },
40 jshint: {
41 files: [
42 'lib/**/*.js'
43 ],
44 options: {
45 jshintrc: '.jshintrc'
46 }
47 },
48 mocha: {
49 browser: {
50 src: ['test/test-browser.html'],
51 options: {
52 run: true
53 }
54 },
55 amd: {
56 src: ['test/test-amd.html'],
57 options: {
58 run: false
59 }
60 }
61 },
62 mochaTest: {
63 unit: {
64 options: {
65 ui: 'tdd',
66 reporter: 'dot'
67 },
68 src: ['test/**/*_test.js']
69 },
70 coverage: {
71 options: {
72 ui: 'tdd',
73 reporter: 'mocha-lcov-reporter',
74 require: 'coverage/blanket',
75 quiet: true,
76 captureFile: 'coverage.lcov'
77 },
78 src: ['test/**/*_test.js']
79 }
80 },
81 watch: {
82 unit: {
83 files: ['test/**/*.js', 'lib/**/*.js'],
84 tasks: ['unit']
85 }
86 }
87 });
88
89 grunt.registerTask('unit', ['jshint', 'mochaTest:unit']);
90 grunt.registerTask('test', ['jshint', 'mochaTest:unit', 'mocha:browser', 'mocha:amd']);
91 grunt.registerTask('coverage', ['mochaTest:coverage']);
92};