-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
90 lines (88 loc) · 3.2 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
/* global module, process */
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
base: "",
port: 9999
}
}
},
jshint: {
allFiles: [
'Gruntfile.js',
'src/**/*.js',
'test/**/*.spec.js'
],
options: {
jshintrc: '.jshintrc'
}
},
concat: {
options: {
separator: ';'
},
dist: {
src: ['src/**/*.js'],
dest: 'dist/<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'dist/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
}
}
},
jasmine: {
custom: {
src: 'src/**/*.js',
options: {
specs: 'test/**/*.spec.js',
vendor: [
'http://code.jquery.com/jquery-1.11.1.min.js',
'node_modules/jasmine-jquery/lib/jasmine-jquery.js',
'test/jasmine-jsreporter.js'
],
keepRunner: true
}
}
},
'saucelabs-jasmine': {
all: {
options: {
// username: process.env.SAUCE_USERNAME,
tunneltimeout: 5,
// key: process.env.SAUCE_ACCESS_KEY,
urls: [ 'http://127.0.0.1:9999/_SpecRunner.html' ],
build: process.env.TRAVIS_JOB_ID || '<%= pkg.version %>',
concurrency: 3,
testname: 'Sauce Unit Tests for Jquery Utils',
tags: ['master'],
browsers: [
{ browserName: 'firefox', version: '32', platform: 'OS X 10.6' },
{ browserName: 'chrome', version: '37', platform: 'OS X 10.6' },
{ browserName: 'firefox', version: '32', platform: 'Windows 7' },
{ browserName: 'chrome', version: '37', platform: 'Windows 7' },
{ browserName: 'internet explorer', version: '9', platform: 'Windows 7' },
{ browserName: 'internet explorer', version: '10', platform: 'Windows 7' }
]
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.registerTask('local-test', ['jshint','jasmine']);
grunt.registerTask('test', ['jshint', 'jasmine', 'connect', 'saucelabs-jasmine']);
grunt.registerTask('default', ['jshint', 'jasmine', 'concat', 'uglify']);
};