Skip to content

Commit

Permalink
Updated test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
risadams committed Jan 27, 2022
1 parent d71d8b1 commit 2356b42
Show file tree
Hide file tree
Showing 5 changed files with 4,277 additions and 3,004 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules
bower_components
*.log
.vscode
build
build
coverage/
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fund=false
122 changes: 38 additions & 84 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,87 +1,41 @@
module.exports = function(config) {
// workaround for https://github.com/karma-runner/karma-sauce-launcher/issues/40
var saucelabsBatchID = Number(process.env.SAUCELABS_BATCH) - 1;
var saucelabsConcurrency = 4;
var saucelabsBrowsers = [
// mobile
{platform: 'OS X 10.10', browserName: 'iPhone', version: '8.1'},
//{platform: 'OS X 10.10 ', browserName: 'iPhone', version: '6.0'},
{platform: 'OS X 10.10', browserName: 'iPad', version: '8.1'},
//{platform: 'OS X 10.10', browserName: 'iPad', version: '6.0'},
{platform: 'Linux', browserName: 'android', version: '4.4'},
{platform: 'Linux', browserName: 'android', version: '4.3'},
// desktop (safari)
{platform: 'OS X 10.8', browserName: 'safari', version: 6},
{platform: 'OS X 10.9', browserName: 'safari', version: 7},
{platform: 'OS X 10.10', browserName: 'safari', version: 8},
// desktop (chrome)
{platform: 'OS X 10.10', browserName: 'chrome', version: 39},
{platform: 'OS X 10.10', browserName: 'chrome', version: 38},
{platform: 'OS X 10.10', browserName: 'chrome', version: 37},
{platform: 'Windows 7', browserName: 'chrome', version: 39},
{platform: 'Windows 7', browserName: 'chrome', version: 38},
{platform: 'Windows 7', browserName: 'chrome', version: 37},
// desktop (firefox)
{platform: 'Windows 7', browserName: 'firefox', version: 35},
{platform: 'Windows 8', browserName: 'firefox', version: 35},
{platform: 'OS X 10.10', browserName: 'firefox', version: 34},
{platform: 'OS X 10.10', browserName: 'firefox', version: 33},
{platform: 'OS X 10.10', browserName: 'firefox', version: 32},
// desktop (internet explorer)
{platform: 'Windows 8', browserName: 'iexplore', version: 10},
{platform: 'Windows 8.1', browserName: 'iexplore', version: 11},
{platform: 'Windows 7', browserName: 'iexplore', version: 9}
];
module.exports = function (config) {
var targets = {
'phantomjs': ['PhantomJS']
};

if (process.env.TARGET === 'saucelabs') {
saucelabsBrowsers = saucelabsBrowsers.slice(saucelabsBatchID * saucelabsConcurrency, saucelabsBatchID * saucelabsConcurrency + saucelabsConcurrency);
if (!saucelabsBrowsers.length) process.exit(0);
}
var browsers = targets[process.env.TARGET || 'phantomjs'];
if (process.env.BROWSERS) {
browsers = process.env.BROWSERS.split(',');
}

var customLaunchers = {};
saucelabsBrowsers.forEach(function(browser, i) {
browser.base = 'SauceLabs';
customLaunchers['SL_' + i] = browser;
});

var targets = {
'saucelabs': Object.keys(customLaunchers),
'phantomjs': ['PhantomJS']
};

var browsers = targets[process.env.TARGET || 'phantomjs'];
if (process.env.BROWSERS) {
browsers = process.env.BROWSERS.split(',');
}

config.set({
frameworks: ['mocha', 'chai'],
files: [
'dist/css/selectize.default.css',
'node_modules/jquery/dist/jquery.js',
'node_modules/microplugin/src/microplugin.js',
'node_modules/sifter/sifter.js',
'test/support/*.js',
'src/contrib/*.js',
'src/constants.js',
'src/utils.js',
'src/selectize.js',
'src/defaults.js',
'src/selectize.jquery.js',
'test/*.js'
],
preprocessors: {
'src/*.js': ['coverage']
},
customLaunchers: customLaunchers,
port: 8888,
colors: true,
captureTimeout: 0,
logLevel: config.LOG_INFO,
browsers: browsers,
browserDisconnectTolerance: 2,
browserDisconnectTimeout: 10000,
browserNoActivityTimeout: 120000,
singleRun: true
});
config.set({
frameworks: ['mocha', 'chai'],
files: [
'dist/css/selectize.default.css',
'node_modules/jquery/dist/jquery.js',
'node_modules/microplugin/src/microplugin.js',
'node_modules/sifter/sifter.js',
'test/support/*.js',
'src/contrib/*.js',
'src/constants.js',
'src/utils.js',
'src/selectize.js',
'src/defaults.js',
'src/selectize.jquery.js',
'test/*.js'
],
preprocessors: {
'src/*.js': ['coverage']
},
reporters: ['progress', 'coverage'],
port: 8888,
colors: true,
captureTimeout: 0,
logLevel: config.LOG_INFO,
browsers: browsers,
browserDisconnectTolerance: 2,
browserDisconnectTimeout: 10000,
browserNoActivityTimeout: 120000,
singleRun: true
});
};
Loading

0 comments on commit 2356b42

Please sign in to comment.