mirror of
https://github.com/videojs/video.js.git
synced 2024-12-29 02:57:21 +02:00
remove minified tests from grunt test task
This commit is contained in:
parent
dfa791581f
commit
44953cf99b
@ -364,6 +364,14 @@ module.exports = function(grunt) {
|
||||
// Development watch task. Doing the minimum required.
|
||||
grunt.registerTask('dev', ['jshint', 'less', 'browserify', 'karma:chrome']);
|
||||
|
||||
// Tests.
|
||||
// We want to run things a little differently if it's coming from Travis vs local
|
||||
if (process.env.TRAVIS) {
|
||||
grunt.registerTask('test', ['build', 'test-travis', 'coveralls']);
|
||||
} else {
|
||||
grunt.registerTask('test', ['build', 'test-local']);
|
||||
}
|
||||
|
||||
// Load all the tasks in the tasks directory
|
||||
grunt.loadTasks('build/tasks');
|
||||
};
|
||||
|
28
build/tasks/test-local.js
Normal file
28
build/tasks/test-local.js
Normal file
@ -0,0 +1,28 @@
|
||||
module.exports = function(grunt) {
|
||||
// You can specify which browsers to build with by using grunt-style arguments
|
||||
// or separating them with a comma:
|
||||
// grunt test:chrome:firefox # grunt-style
|
||||
// grunt test:chrome,firefox # comma-separated
|
||||
grunt.registerTask('test-local', function() {
|
||||
var tasks = this.args;
|
||||
var tasksMinified;
|
||||
|
||||
// if we aren't running this in a CI, but running it manually, we can
|
||||
// supply arguments to this task. These arguments are either colon (`:`)
|
||||
// separated which is the default grunt separator for arguments, or they
|
||||
// are comma (`,`) separated to make it easier.
|
||||
// The arguments are the names of which browsers you want.
|
||||
if (tasks.length === 0) {
|
||||
tasks.push('chrome');
|
||||
}
|
||||
if (tasks.length === 1) {
|
||||
tasks = tasks[0].split(',');
|
||||
}
|
||||
|
||||
tasks = tasks.map(function(task) {
|
||||
return 'karma:' + task;
|
||||
});
|
||||
|
||||
grunt.task.run(tasks);
|
||||
});
|
||||
};
|
30
build/tasks/test-travis.js
Normal file
30
build/tasks/test-travis.js
Normal file
@ -0,0 +1,30 @@
|
||||
module.exports = function(grunt) {
|
||||
// The test task will run `karma:saucelabs` when running in travis,
|
||||
// when running via a PR from a fork, it'll run qunit tests in phantom using
|
||||
// karma otherwise, it'll run the tests in chrome via karma
|
||||
// You can specify which browsers to build with by using grunt-style arguments
|
||||
// or separating them with a comma:
|
||||
// grunt test:chrome:firefox # grunt-style
|
||||
// grunt test:chrome,firefox # comma-separated
|
||||
grunt.registerTask('test-travis', function() {
|
||||
var tasks = this.args;
|
||||
var tasksMinified;
|
||||
|
||||
// I believe this was done originally because of security implications around running
|
||||
// Saucelabs automatically on PRs.
|
||||
if (process.env.TRAVIS_PULL_REQUEST !== 'false') {
|
||||
grunt.task.run(['karma:firefox']);
|
||||
} else {
|
||||
grunt.task.run(['karma:firefox']);
|
||||
//Disabling saucelabs until we figure out how to make it run reliably.
|
||||
//grunt.task.run([
|
||||
//'karma:chrome_sl',
|
||||
//'karma:firefox_sl',
|
||||
//'karma:safari_sl',
|
||||
//'karma:ipad_sl',
|
||||
//'karma:android_sl',
|
||||
//'karma:ie_sl'
|
||||
//]);
|
||||
}
|
||||
});
|
||||
};
|
@ -1,63 +0,0 @@
|
||||
module.exports = function(grunt) {
|
||||
// The test task will run `karma:saucelabs` when running in travis,
|
||||
// when running via a PR from a fork, it'll run qunit tests in phantom using
|
||||
// karma otherwise, it'll run the tests in chrome via karma
|
||||
// You can specify which browsers to build with by using grunt-style arguments
|
||||
// or separating them with a comma:
|
||||
// grunt test:chrome:firefox # grunt-style
|
||||
// grunt test:chrome,firefox # comma-separated
|
||||
grunt.registerTask('test', function() {
|
||||
var tasks = this.args,
|
||||
tasksMinified,
|
||||
tasksMinifiedApi;
|
||||
|
||||
// I believe this was done originally because of security implications around running
|
||||
// Saucelabs automatically on PRs.
|
||||
if (process.env.TRAVIS && process.env.TRAVIS_PULL_REQUEST !== 'false') {
|
||||
grunt.task.run(['karma:firefox', 'coveralls']);
|
||||
} else if (process.env.TRAVIS) {
|
||||
grunt.task.run(['karma:firefox', 'coveralls']);
|
||||
//Disabling saucelabs until we figure out how to make it run reliably.
|
||||
//grunt.task.run([
|
||||
//'karma:chrome_sl',
|
||||
//'karma:firefox_sl',
|
||||
//'karma:safari_sl',
|
||||
//'karma:ipad_sl',
|
||||
//'karma:android_sl',
|
||||
//'karma:ie_sl'
|
||||
//]);
|
||||
} else {
|
||||
// if we aren't running this in a CI, but running it manually, we can
|
||||
// supply arguments to this task. These arguments are either colon (`:`)
|
||||
// separated which is the default grunt separator for arguments, or they
|
||||
// are comma (`,`) separated to make it easier.
|
||||
// The arguments are the names of which browsers you want. It'll then
|
||||
// make sure you have the `minified` and `minified_api` for those browsers
|
||||
// as well.
|
||||
if (tasks.length === 0) {
|
||||
tasks.push('chrome');
|
||||
}
|
||||
if (tasks.length === 1) {
|
||||
tasks = tasks[0].split(',');
|
||||
}
|
||||
|
||||
tasksMinified = tasks.slice();
|
||||
tasksMinifiedApi = tasks.slice();
|
||||
|
||||
tasksMinified = tasksMinified.map(function(task) {
|
||||
return 'minified_' + task;
|
||||
});
|
||||
|
||||
tasksMinifiedApi = tasksMinifiedApi.map(function(task) {
|
||||
return 'minified_api_' + task;
|
||||
});
|
||||
|
||||
tasks = tasks.concat(tasksMinified).concat(tasksMinifiedApi);
|
||||
tasks = tasks.map(function(task) {
|
||||
return 'karma:' + task;
|
||||
});
|
||||
|
||||
grunt.task.run(tasks);
|
||||
}
|
||||
});
|
||||
};
|
Loading…
Reference in New Issue
Block a user