forked from marmelab/ng-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
69 lines (64 loc) · 2.25 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
/*global module*/
module.exports = function (grunt) {
'use strict';
// Define the configuration for all the tasks
grunt.initConfig({
copy: {
test_build: {
src: 'build/*',
dest: 'src/javascripts/test/fixtures/examples/blog/'
},
test_sample_app: {
src: 'examples/blog/*',
dest: 'src/javascripts/test/fixtures/',
options: {
process: function(content) {
return content.replace(/http\:\/\/localhost\:8000\//g, '/');
}
}
},
test_fakerest: {
src: 'node_modules/fakerest/dist/FakeRest.min.js',
dest: 'src/javascripts/test/fixtures/examples/blog/build/fakerest.js'
},
test_sinon_server: {
src: 'node_modules/sinon/pkg/sinon-server-1.14.1.js',
dest: 'src/javascripts/test/fixtures/examples/blog/build/sinon-server.js'
}
},
connect: {
dev: {
options: {
port: 8000,
base: 'examples/blog/',
keepalive: false,
livereload: false
}
},
test: {
options: {
port: 8001,
base: 'src/javascripts/test/fixtures/examples/blog/',
keepalive: false,
livereload: false
}
}
},
protractor: {
e2e: {
configFile: 'src/javascripts/test/protractor.conf.js',
keepAlive: true,
debug: true
}
},
exec: {
webpack: './node_modules/webpack/bin/webpack.js'
}
});
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-exec');
grunt.loadNpmTasks('grunt-protractor-runner');
grunt.registerTask('test:e2e', ['test:e2e:prepare', 'connect:test', 'protractor']);
grunt.registerTask('test:e2e:prepare', ['exec:webpack', 'copy:test_sample_app', 'copy:test_build', 'copy:test_fakerest', 'copy:test_sinon_server']);
};