diff --git a/LICENSE.txt b/LICENSE.txt index ed6b657..ee81d20 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -42,12 +42,6 @@ licenses (all MPL 2.0 compatible): vendor/pako/ : MIT - vendor/browser-es-module-loader/src/ : MIT - - vendor/browser-es-module-loader/dist/ : Various BSD style licenses - - vendor/promise.js : MIT - Any other files not mentioned above are typically marked with a copyright/license header at the top of the file. The default noVNC license is MPL-2.0. diff --git a/karma.conf.js b/karma.conf.js index c295b1f..1ea1747 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -31,16 +31,13 @@ module.exports = (config) => { // list of files / patterns to load in the browser (loaded in order) files: [ - { pattern: 'app/localization.js', included: false }, - { pattern: 'app/webutil.js', included: false }, - { pattern: 'core/**/*.js', included: false }, - { pattern: 'vendor/pako/**/*.js', included: false }, - { pattern: 'vendor/browser-es-module-loader/dist/*.js*', included: false }, - { pattern: 'tests/test.*.js', included: false }, - { pattern: 'tests/fake.*.js', included: false }, - { pattern: 'tests/assertions.js', included: false }, - 'vendor/promise.js', - 'tests/karma-test-main.js', + { pattern: 'app/localization.js', included: false, type: 'module' }, + { pattern: 'app/webutil.js', included: false, type: 'module' }, + { pattern: 'core/**/*.js', included: false, type: 'module' }, + { pattern: 'vendor/pako/**/*.js', included: false, type: 'module' }, + { pattern: 'tests/test.*.js', type: 'module' }, + { pattern: 'tests/fake.*.js', included: false, type: 'module' }, + { pattern: 'tests/assertions.js', type: 'module' }, ], client: { diff --git a/package.json b/package.json index 8fc04e5..660f16e 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "scripts": { "lint": "eslint app core po/po2js po/xgettext-html tests utils", "test": "karma start karma.conf.js", - "prepublish": "node ./utils/use_require.js --as commonjs --clean" + "prepublish": "node ./utils/use_require.js --clean" }, "repository": { "type": "git", @@ -42,10 +42,7 @@ "devDependencies": { "@babel/core": "*", "@babel/plugin-syntax-dynamic-import": "*", - "@babel/plugin-transform-modules-amd": "*", "@babel/plugin-transform-modules-commonjs": "*", - "@babel/plugin-transform-modules-systemjs": "*", - "@babel/plugin-transform-modules-umd": "*", "@babel/preset-env": "*", "@babel/cli": "*", "babel-plugin-import-redirect": "*", diff --git a/tests/karma-test-main.js b/tests/karma-test-main.js deleted file mode 100644 index 2843666..0000000 --- a/tests/karma-test-main.js +++ /dev/null @@ -1,48 +0,0 @@ -const TEST_REGEXP = /test\..*\.js/; -const allTestFiles = []; -const extraFiles = ['/base/tests/assertions.js']; - -Object.keys(window.__karma__.files).forEach(function (file) { - if (TEST_REGEXP.test(file)) { - // TODO: normalize? - allTestFiles.push(file); - } -}); - -// Stub out mocha's start function so we can run it once we're done loading -mocha.origRun = mocha.run; -mocha.run = function () {}; - -let script; - -// Script to import all our tests -script = document.createElement("script"); -script.type = "module"; -script.text = ""; -let allModules = allTestFiles.concat(extraFiles); -allModules.forEach(function (file) { - script.text += "import \"" + file + "\";\n"; -}); -script.text += "\nmocha.origRun();\n"; -document.body.appendChild(script); - -// Fallback code for browsers that don't support modules (IE) -script = document.createElement("script"); -script.type = "module"; -script.text = "window._noVNC_has_module_support = true;\n"; -document.body.appendChild(script); - -function fallback() { - if (!window._noVNC_has_module_support) { - /* eslint-disable no-console */ - if (console) { - console.log("No module support detected. Loading fallback..."); - } - /* eslint-enable no-console */ - let loader = document.createElement("script"); - loader.src = "base/vendor/browser-es-module-loader/dist/browser-es-module-loader.js"; - document.body.appendChild(loader); - } -} - -setTimeout(fallback, 500); diff --git a/tests/vnc_playback.html b/tests/vnc_playback.html index 4fd7465..ffa6990 100644 --- a/tests/vnc_playback.html +++ b/tests/vnc_playback.html @@ -2,21 +2,6 @@