Add transpilation for IE11 and skip linux tests
This commit is contained in:
parent
8727f598c2
commit
cdb860ad84
|
@ -1,29 +1,30 @@
|
|||
// Karma configuration
|
||||
|
||||
module.exports = function(config) {
|
||||
var customLaunchers = {};
|
||||
var browsers = [];
|
||||
var useSauce = false;
|
||||
const customLaunchers = {};
|
||||
let browsers = [];
|
||||
let useSauce = false;
|
||||
let transpileToES5 = ['internet explorer'].includes(process.env.TEST_BROWSER_NAME);
|
||||
|
||||
// use Sauce when running on Travis
|
||||
if (process.env.TRAVIS_JOB_NUMBER) {
|
||||
useSauce = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (useSauce && process.env.TEST_BROWSER_NAME && process.env.TEST_BROWSER_NAME != 'PhantomJS') {
|
||||
var names = process.env.TEST_BROWSER_NAME.split(',');
|
||||
var platforms = process.env.TEST_BROWSER_OS.split(',');
|
||||
var versions = [];
|
||||
if (process.env.TEST_BROWSER_VERSION) {
|
||||
versions = process.env.TEST_BROWSER_VERSION.split(',');
|
||||
} else {
|
||||
versions = [null];
|
||||
}
|
||||
const names = process.env.TEST_BROWSER_NAME.split(',');
|
||||
const platforms = process.env.TEST_BROWSER_OS.split(',');
|
||||
const versions = process.env.TEST_BROWSER_VERSION
|
||||
? process.env.TEST_BROWSER_VERSION.split(',')
|
||||
: [null];
|
||||
|
||||
for (var i = 0; i < names.length; i++) {
|
||||
for (var j = 0; j < platforms.length; j++) {
|
||||
for (var k = 0; k < versions.length; k++) {
|
||||
var launcher_name = 'sl_' + platforms[j].replace(/[^a-zA-Z0-9]/g, '') + '_' + names[i];
|
||||
for (let i = 0; i < names.length; i++) {
|
||||
for (let j = 0; j < platforms.length; j++) {
|
||||
// FIXME Skip tests in Linux since Sauce Labs browser versions are ancient.
|
||||
// https://github.com/novnc/noVNC/pull/1013#issuecomment-382749805
|
||||
if (platforms[j] === 'Linux') continue;
|
||||
for (let k = 0; k < versions.length; k++) {
|
||||
let launcher_name = 'sl_' + platforms[j].replace(/[^a-zA-Z0-9]/g, '') + '_' + names[i];
|
||||
if (versions[k]) {
|
||||
launcher_name += '_' + versions[k];
|
||||
}
|
||||
|
@ -48,7 +49,7 @@ module.exports = function(config) {
|
|||
browsers = [];
|
||||
}
|
||||
|
||||
var my_conf = {
|
||||
const my_conf = {
|
||||
|
||||
// base path that will be used to resolve all patterns (eg. files, exclude)
|
||||
basePath: '',
|
||||
|
@ -103,6 +104,7 @@ module.exports = function(config) {
|
|||
|
||||
babelPreprocessor: {
|
||||
options: {
|
||||
presets: transpileToES5 ? ['es2015'] : [],
|
||||
plugins: ['transform-es2015-modules-amd', 'syntax-dynamic-import'],
|
||||
sourceMap: 'inline',
|
||||
},
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
"babel-plugin-transform-es2015-modules-commonjs": "^6.18.0",
|
||||
"babel-plugin-transform-es2015-modules-systemjs": "^6.22.0",
|
||||
"babel-plugin-transform-es2015-modules-umd": "^6.22.0",
|
||||
"babel-preset-es2015": "^6.24.1",
|
||||
"babelify": "^7.3.0",
|
||||
"browserify": "^13.1.0",
|
||||
"chai": "^3.5.0",
|
||||
|
|
|
@ -151,6 +151,7 @@ var make_lib_files = function (import_format, source_maps, with_app_dir, only_le
|
|||
// NB: we need to make a copy of babel_opts, since babel sets some defaults on it
|
||||
const babel_opts = () => ({
|
||||
plugins: [`transform-es2015-modules-${import_format}`],
|
||||
presets: ['es2015'],
|
||||
ast: false,
|
||||
sourceMaps: source_maps,
|
||||
});
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -6,6 +6,7 @@ import babelTransformES2015ModulesSystemJS from 'babel-plugin-transform-es2015-m
|
|||
var babelTransform = require('babel-core').transform;
|
||||
var babelTransformDynamicImport = require('babel-plugin-syntax-dynamic-import');
|
||||
var babelTransformES2015ModulesSystemJS = require('babel-plugin-transform-es2015-modules-systemjs');
|
||||
var babelPresetES2015 = require('babel-preset-es2015');
|
||||
|
||||
self.onmessage = function (evt) {
|
||||
// transform source with Babel
|
||||
|
@ -17,6 +18,7 @@ self.onmessage = function (evt) {
|
|||
sourceMaps: 'inline',
|
||||
babelrc: false,
|
||||
plugins: [babelTransformDynamicImport, babelTransformES2015ModulesSystemJS],
|
||||
presets: [babelPresetES2015],
|
||||
});
|
||||
|
||||
self.postMessage({key: evt.data.key, code: output.code, source: evt.data.source});
|
||||
|
|
Loading…
Reference in New Issue