commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / bower_components / angular-unsavedChanges / Gruntfile.js
1 // @todo configure grunt default stuff to run on every save so we know that
2 // dist is always up to date and jsLinted
3
4 module.exports = function(grunt) {
5
6 require('load-grunt-tasks')(grunt, {
7 scope: ['dependencies', 'devDependencies']
8 });
9
10 grunt.initConfig({
11 // end 2 end testing with protractor
12 protractor: {
13 options: {
14 keepAlive: false,
15 configFile: './protractor.conf.js'
16 },
17 singlerun: {},
18 travis: {
19 configFile: './protractor_travis.conf.js'
20 },
21 auto: {
22 keepAlive: true,
23 options: {
24 args: {
25 seleniumPort: 4444
26 }
27 }
28 }
29 },
30 connect: {
31 server: {
32 options: {
33 port: 9001,
34 open: 'http://localhost:9001/demo',
35 keepalive: true
36 }
37 },
38 // our protractor server
39 testserver: {
40 options: {
41 port: 9999
42 }
43 },
44 travisServer: {
45 options: {
46 port: 9999
47 }
48 },
49 },
50 // watch tasks
51 // Watch specified files for changes and execute tasks on change
52 watch: {
53 livereload: {
54 options: {
55 livereload: true
56 },
57 files: [
58 'src/*.js',
59 'demo/*.js'
60 ],
61 tasks: ['jshint']
62 },
63 },
64 karma: {
65 plugins: [
66 'karma-osx-reporter'
67 ],
68 unit: {
69 configFile: 'karma-unit.conf.js',
70 autoWatch: false,
71 singleRun: true
72 },
73 unitAuto: {
74 configFile: 'karma-unit.conf.js',
75 autoWatch: true,
76 singleRun: false
77 }
78 },
79 'min': {
80 'dist': {
81 'src': ['dist/unsavedChanges.js'],
82 'dest': 'dist/unsavedChanges.min.js'
83 }
84 },
85 jshint: {
86 all: ['src/*.js']
87 },
88 strip: {
89 main: {
90 src: 'src/unsavedChanges.js',
91 dest: 'dist/unsavedChanges.js'
92 }
93 }
94
95 });
96
97 grunt.registerTask('test', [
98 'test:unit'
99 ]);
100
101 grunt.registerTask('server', [
102 'connect:server'
103 ]);
104
105 grunt.registerTask('test:unit', [
106 'karma:unit'
107 ]);
108
109 grunt.registerTask('autotest', [
110 'autotest:unit'
111 ]);
112
113 grunt.registerTask('autotest:unit', [
114 'karma:unitAuto'
115 ]);
116
117 grunt.registerTask('default', [
118 'jshint',
119 'strip:main',
120 'min'
121 ]);
122
123 grunt.registerTask('autotest:e2e', [
124 'connect:testserver', // - starts the app so the test runner can visit the app
125 'shell:selenium', // - starts selenium server in watch mode
126 'watch:protractor' // - watches scripts and e2e specs, and starts tests on file change
127 ]);
128
129 grunt.registerTask('test:e2e', [
130 'connect:testserver', // - run concurrent tests
131 'protractor:singlerun' // - single run protractor
132 ]);
133
134 grunt.registerTask('test:travis', [
135 'connect:travisServer', // - run concurrent tests
136 'karma:unit' // - single run karma unit
137 ]);
138
139 };