-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathgulpfile.js
More file actions
44 lines (37 loc) · 1.07 KB
/
gulpfile.js
File metadata and controls
44 lines (37 loc) · 1.07 KB
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
var gulp = require('gulp');
var path = require('path')
gulp.task('test', function () {
var karma = require('karma').Server,
testConfig = {
configFile: path.join(__dirname, './spec/karma.conf.js'),
singleRun: true
};
testConfig.browsers = ['PhantomJSCustom'];
function isArgv(optName) {
return process.argv.indexOf(optName) !== -1;
}
if (isArgv('--chrome')) {
testConfig.browsers.push('Chrome');
}
if (isArgv('--safari')) {
testConfig.browsers.push('Safari');
}
if (isArgv('--ff')) {
testConfig.browsers.push('Firefox');
}
if (isArgv('--ie')) {
testConfig.browsers.push('IE');
}
console.log('Running tests...');
new karma(testConfig, function (exitCode) {
if (!exitCode) {
console.log('\tTests ran successfully.\n');
} else {
process.exit(exitCode);
}
}).start();
});
gulp.task('copy2ex', function() {
return gulp.src(['dist/popo.min.js'])
.pipe(gulp.dest('docs/examples/libs'));
});