UNPKG

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