-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
45 lines (41 loc) · 1.35 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
const path = require('path');
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
connect: {
server: {
options: {
port: 8080,
hostname: 'localhost'
}
}
},
qunit: {
all: {
options: {
urls: ['http://localhost:8080/tests/index.html']
},
},
},
shell: {
ui_test: {
command: `${path.join('node_modules', '.bin', 'qunit')} ${path.join('tests', 'tests.ui.js')}`
}
},
copy: {
main: {
src: `${path.join('node_modules', 'knockout', 'build', 'output', 'knockout-latest.js')}` ,
dest: `${path.join('js', 'knockout-min.js')}`,
},
}
});
// Load plugin
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-run');
grunt.registerTask('default', ['deploy', 'connect', 'qunit', 'shell:ui_test']);
grunt.registerTask('deploy', ['copy']);
grunt.registerTask('test', ['deploy', 'connect', 'qunit']);
grunt.registerTask('ui_test', ['connect', 'deploy', 'shell:ui_test']);
};