This repository has been archived by the owner on Jul 10, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
87 lines (82 loc) · 2.87 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
jshint: {
all: ['*.js', 'src/*.js', 'test/*-test.js', 'test/background.js'],
options: {
jshintrc: '.jshintrc'
}
},
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['test/unit-test.js', 'test/local-integration-test.js']
}
},
watch: {
unit: {
files: ['test/unit-test.js'],
tasks: ['unit']
},
// integration: {
// files: ['test/integration-test.js', 'test/browser-test.js'],
// tasks: ['integration']
// },
js: {
files: ['src/*.js'],
tasks: ['unit']
}
},
copy: {
npm: {
expand: true,
flatten: true,
cwd: 'node_modules/',
src: [
'chai/chai.js',
'mocha/mocha.*',
'requirejs/require.js',
'nodemailer/src/*',
'mailcomposer/src/*',
'simplesmtp/src/*',
'simplesmtp/node_modules/xoauth2/src/xoauth2.js',
'nodemailer/src/*',
'node-shims/src/*.js',
'node-shims/node_modules/node-forge/js/*.js',
'node-shims/node_modules/setimmediate/setImmediate.js',
'mailcomposer/node_modules/mime/src/*',
'mailcomposer/node_modules/mimelib/src/mimelib.js',
'mailcomposer/node_modules/mimelib/node_modules/addressparser/src/addressparser.js',
'mailcomposer/node_modules/mimelib/node_modules/encoding/src/encoding.js',
'mailcomposer/node_modules/mimelib/node_modules/encoding/node_modules/iconv-lite/src/*.js',
],
dest: 'test/lib/'
},
app: {
expand: true,
flatten: true,
cwd: 'src/',
src: [
'*.js',
],
dest: 'test/lib/'
}
},
clean: {
test: ['test/lib/']
}
});
// Load the plugin(s)
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
// Default task(s).
grunt.registerTask('unit', ['jshint', 'mochaTest']);
grunt.registerTask('integration', ['jshint', 'clean:test', 'copy']);
grunt.registerTask('default', ['jshint', 'mochaTest', 'clean:test', 'copy']);
};