forked from blackboard/protractor-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
105 lines (88 loc) · 2.1 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
'use strict';
var ab = require('asyncblock');
var config = require('./test/config.js');
if (ab.enableTransform(module)) {
return;
}
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
clean: {
build: 'build',
dist: 'dist'
},
copy: {
dist: {
expand: true,
cwd: 'build/develop/app',
src: ['*.js', '*.d.ts'],
dest: 'dist'
},
prepareModuleDefinition: {
expand: true,
cwd: 'dist',
src: 'protractor_sync.d.ts',
dest: 'dist',
options: {
process: function (content, srcpath) {
//Convert to an ambient module, which will allow it to be "required"
return content.replace(/export declare module protractor_sync/, 'declare module "protractor_sync"');
}
}
}
},
protractor: {
options: {
configFile: 'test/protractor.conf.js'
},
tests: {}
},
shell: {
webdriverUpdate: {
command: 'node ./node_modules/webdriver-manager/bin/webdriver-manager update --versions.chrome '+config.chromedriverVersion
},
webdriverStart: {
command: 'node ./node_modules/webdriver-manager/bin/webdriver-manager start --versions.chrome '+config.chromedriverVersion
}
},
ts: {
options: {
compiler: 'node_modules/typescript/bin/tsc'
},
build: {
tsconfig: 'tsconfig.json'
},
watchApp: {
tsconfig: 'tsconfig.json',
watch: '.'
}
},
tslint: {
options: {
configuration: grunt.file.readJSON('tslint.json')
},
all: {
src: [ 'app/**/*.ts', 'test/**/*.ts' ]
}
}
});
grunt.registerTask('build', [
'clean:build',
'ts:build'
]);
grunt.registerTask('develop', [
'ts:watchApp'
]);
grunt.registerTask('test', [
'shell:webdriverUpdate',
'protractor:tests'
]);
grunt.registerTask('verify', [
'tslint:all'
]);
grunt.registerTask('package', [
'clean:dist',
'copy:dist',
'copy:prepareModuleDefinition'
]);
};