forked from opentable/hobknob
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
75 lines (67 loc) · 2.62 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
'use strict';
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
copy: {
build: {
files: [
{expand: true, src: ['src/**'], dest: 'package/'},
{expand: true, src: ['config/**'], dest: 'package/'},
{expand: true, src: ['public/**'], dest: 'package/'},
{expand: true, src: ['routes/**'], dest: 'package/'},
{expand: true, src: ['views/**'], dest: 'package/'},
{src: ['app.js'], dest: 'package/', filter: 'isFile'},
{src: ['package.json'], dest: 'package/', filter: 'isFile'},
{src: ['bower.json'], dest: 'package/', filter: 'isFile'},
{src: ['.bowerrc'], dest: 'package/', filter: 'isFile'}
]
}
},
ngconstant: {
options: {
name: 'config',
dest: 'client/configuration/config.js',
space: ' ',
wrap: '{%= __ngModule %}',
constants: {
ENV: require('./config/config.json')
}
},
copyConfigToClient: {}
},
protractor: {
options: {
configFile: 'client/tests/e2e/protractor.conf.js',
keepAlive: true,
noColor: false,
args: {
seleniumServerJar: 'node_modules/protractor/selenium/selenium-server-standalone-2.47.1.jar',
chromeDriver: 'node_modules/protractor/selenium/chromedriver'
}
},
run: {}
},
eslint: {
target: [
'Gruntfile.js',
'server/**/*.js',
'client/**/*.js',
'!client/public/**/*.js',
'!client/js/common/lib/**/*.js',
'!client/tests/**/*.js',
'!client/configuration/**/*.js'
]
},
simplemocha: {
test: {
src: ['server/tests/**/*.js']
}
}
});
// Automatically load in all Grunt npm tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.registerTask('default', 'build');
grunt.registerTask('build', ['copyConfigToClient', 'eslint']);
grunt.registerTask('copyConfigToClient', ['ngconstant:copyConfigToClient']);
grunt.registerTask('test', ['eslint', 'simplemocha', 'protractor:run']);
};