mirror of
https://git.proxmox.com/git/mirror_novnc
synced 2025-04-28 11:09:24 +00:00
Manually load sinon and chai
karma-sinon-chai is not compatible with Chai 5+, and Karma is no longer being updated. Load sinon and chai manually instead, until we can have a long term plan in place.
This commit is contained in:
parent
bc31e4e8a2
commit
1b2fe3321b
@ -79,7 +79,7 @@ export default [
|
||||
...globals.node,
|
||||
...globals.mocha,
|
||||
sinon: false,
|
||||
chai: false,
|
||||
expect: false,
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
|
@ -27,15 +27,22 @@ module.exports = (config) => {
|
||||
|
||||
// frameworks to use
|
||||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
||||
frameworks: ['mocha', 'sinon-chai'],
|
||||
frameworks: ['mocha'],
|
||||
|
||||
// list of files / patterns to load in the browser (loaded in order)
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
// node modules
|
||||
{ pattern: 'node_modules/chai/**', included: false },
|
||||
{ pattern: 'node_modules/sinon/**', included: false },
|
||||
{ pattern: 'node_modules/sinon-chai/**', included: false },
|
||||
// modules to test
|
||||
{ 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' },
|
||||
// tests
|
||||
{ pattern: 'tests/test.*.js', type: 'module' },
|
||||
// test support files
|
||||
{ pattern: 'tests/fake.*.js', included: false, type: 'module' },
|
||||
{ pattern: 'tests/assertions.js', type: 'module' },
|
||||
],
|
||||
|
@ -55,7 +55,6 @@
|
||||
"karma-mocha-reporter": "latest",
|
||||
"karma-safari-launcher": "latest",
|
||||
"karma-script-launcher": "latest",
|
||||
"karma-sinon-chai": "latest",
|
||||
"mocha": "latest",
|
||||
"node-getopt": "latest",
|
||||
"po2json": "latest",
|
||||
|
@ -1,3 +1,12 @@
|
||||
import * as chai from '../node_modules/chai/chai.js';
|
||||
import sinon from '../node_modules/sinon/pkg/sinon-esm.js';
|
||||
import sinonChai from '../node_modules/sinon-chai/lib/sinon-chai.js';
|
||||
|
||||
window.expect = chai.expect;
|
||||
|
||||
window.sinon = sinon;
|
||||
chai.use(sinonChai);
|
||||
|
||||
// noVNC specific assertions
|
||||
chai.use(function (_chai, utils) {
|
||||
function _equal(a, b) {
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import Base64 from '../core/base64.js';
|
||||
|
||||
describe('Base64 Tools', function () {
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import { isMac, isWindows, isIOS, isAndroid, isChromeOS,
|
||||
isSafari, isFirefox, isChrome, isChromium, isOpera, isEdge,
|
||||
isGecko, isWebKit, isBlink } from '../core/util/browser.js';
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import Websock from '../core/websock.js';
|
||||
import Display from '../core/display.js';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import { inflateInit, inflate } from "../vendor/pako/lib/zlib/inflate.js";
|
||||
import ZStream from "../vendor/pako/lib/zlib/zstream.js";
|
||||
import Deflator from "../core/deflator.js";
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import Base64 from '../core/base64.js';
|
||||
import Display from '../core/display.js';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import EventTargetMixin from '../core/util/eventtarget.js';
|
||||
|
||||
import GestureHandler from '../core/input/gesturehandler.js';
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import keysyms from '../core/input/keysymdef.js';
|
||||
import * as KeyboardUtil from "../core/input/util.js";
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import Websock from '../core/websock.js';
|
||||
import Display from '../core/display.js';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import { deflateInit, deflate, Z_FULL_FLUSH } from "../vendor/pako/lib/zlib/deflate.js";
|
||||
import ZStream from "../vendor/pako/lib/zlib/zstream.js";
|
||||
import Inflator from "../core/inflator.js";
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import { toUnsigned32bit, toSigned32bit } from '../core/util/int.js';
|
||||
|
||||
describe('Integer casting', function () {
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import Websock from '../core/websock.js';
|
||||
import Display from '../core/display.js';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import Keyboard from '../core/input/keyboard.js';
|
||||
|
||||
describe('Key Event Handling', function () {
|
||||
|
@ -1,4 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
import _, { Localizer, l10n } from '../app/localization.js';
|
||||
|
||||
describe('Localization', function () {
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import Websock from '../core/websock.js';
|
||||
import Display from '../core/display.js';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import RFB from '../core/rfb.js';
|
||||
import Websock from '../core/websock.js';
|
||||
import ZStream from "../vendor/pako/lib/zlib/zstream.js";
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import Websock from '../core/websock.js';
|
||||
import Display from '../core/display.js';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import Websock from '../core/websock.js';
|
||||
import Display from '../core/display.js';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import Websock from '../core/websock.js';
|
||||
import Display from '../core/display.js';
|
||||
|
||||
|
@ -1,6 +1,4 @@
|
||||
/* eslint-disable no-console */
|
||||
const expect = chai.expect;
|
||||
|
||||
import * as Log from '../core/util/logging.js';
|
||||
import { encodeUTF8, decodeUTF8 } from '../core/util/strings.js';
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import Websock from '../core/websock.js';
|
||||
import FakeWebSocket from './fake.websocket.js';
|
||||
|
||||
|
@ -1,7 +1,5 @@
|
||||
/* jshint expr: true */
|
||||
|
||||
const expect = chai.expect;
|
||||
|
||||
import * as WebUtil from '../app/webutil.js';
|
||||
|
||||
describe('WebUtil', function () {
|
||||
|
@ -1,5 +1,3 @@
|
||||
const expect = chai.expect;
|
||||
|
||||
import Websock from '../core/websock.js';
|
||||
import Display from '../core/display.js';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user