Skip to content

Commit

Permalink
fix(web): dom (single-browser) Karma test adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
jahorton committed Apr 29, 2024
1 parent 9ab84a1 commit 78dcafe
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion web/src/test/auto/dom/base.conf.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ module.exports = {

// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai', 'fixture'],
frameworks: ['mocha', 'fixture'],

// list of files / patterns to load in the browser
files: [
{ pattern: 'node_modules/chai/chai.js', watched: true, served: true, included: false, type: 'module'},
{pattern: 'web/src/test/auto/dom/kbdLoader.mjs', type: 'module', watched: true, served: true, included: false},

{pattern: 'web/src/test/auto/dom/test_init_check.js', type: 'module'}, // Ensures that tests will initialize properly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { timedPromise } from '/@keymanapp/web-utils/build/lib/index.mjs';
import sinon from '/node_modules/sinon/pkg/sinon-esm.js';

let assert = chai.assert;
import { assert } from '/node_modules/chai/chai.js';

let STANDARD_OPTIONS = {
owner: null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { PageContextAttachment } from '/@keymanapp/keyman/build/engine/attachment/lib/index.mjs';
import { timedPromise } from '/@keymanapp/web-utils/build/lib/index.mjs';

let assert = chai.assert;
import { assert } from '/node_modules/chai/chai.js';

let STANDARD_OPTIONS = {
owner: null,
Expand Down
2 changes: 1 addition & 1 deletion web/src/test/auto/dom/cases/browser/contextManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { loadKeyboardsFromStubs } from '../../kbdLoader.mjs';
import { timedPromise } from '/@keymanapp/web-utils/build/lib/index.mjs';
import sinon from '/node_modules/sinon/pkg/sinon-esm.js';

const assert = chai.assert;
import { assert } from '/node_modules/chai/chai.js';

const TEST_PHYSICAL_DEVICE = {
formFactor: 'desktop',
Expand Down
2 changes: 1 addition & 1 deletion web/src/test/auto/dom/cases/dom-utils/cookies.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Device from '/@keymanapp/keyman/build/engine/device-detect/lib/index.mjs';
import { default as CookieSerializer } from '/@keymanapp/keyman/build/engine/dom-utils/obj/cookieSerializer.js';

let assert = chai.assert;
import { assert } from '/node_modules/chai/chai.js';

const device = new Device();
device.detect();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let assert = chai.assert;
import { assert } from '/node_modules/chai/chai.js';

import { extendString, Mock } from '/@keymanapp/keyboard-processor/build/lib/index.mjs';
import { Input } from '/@keymanapp/keyman/build/engine/element-wrappers/lib/index.mjs';
Expand Down
2 changes: 1 addition & 1 deletion web/src/test/auto/dom/cases/osk/activation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Device from '/@keymanapp/keyman/build/engine/device-detect/lib/index.mjs'
import { loadKeyboardsFromStubs } from '../../kbdLoader.mjs';
import { timedPromise } from '/@keymanapp/web-utils/build/lib/index.mjs';

let assert = chai.assert;
import { assert } from '/node_modules/chai/chai.js';

const device = new Device();
device.detect();
Expand Down
2 changes: 1 addition & 1 deletion web/src/test/auto/dom/cases/osk/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { timedPromise } from '/@keymanapp/web-utils/build/lib/index.mjs';

import sinon from '/node_modules/sinon/pkg/sinon-esm.js';

let assert = chai.assert;
import { assert } from '/node_modules/chai/chai.js';

const device = new Device();
device.detect();
Expand Down
2 changes: 1 addition & 1 deletion web/src/test/auto/dom/cases/packages/cloudQueries.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const assert = chai.assert;
import { assert } from '/node_modules/chai/chai.js';
import sinon from '/node_modules/sinon/pkg/sinon-esm.js';

import { CloudQueryEngine } from '/@keymanapp/keyman/build/engine/package-cache/lib/index.mjs';
Expand Down
2 changes: 1 addition & 1 deletion web/src/test/auto/dom/cases/packages/domCloudRequester.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const assert = chai.assert;
import { assert } from '/node_modules/chai/chai.js';
import sinon from '/node_modules/sinon/pkg/sinon-esm.js';

import DOMCloudRequester from '/@keymanapp/keyman/build/engine/package-cache/lib/dom-cloud-requester.mjs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const assert = chai.assert;
import { assert } from '/node_modules/chai/chai.js';
import sinon from '/node_modules/sinon/pkg/sinon-esm.js';

import { KeyboardHarness, MinimalKeymanGlobal } from '/@keymanapp/keyboard-processor/build/lib/index.mjs';
Expand Down
2 changes: 1 addition & 1 deletion web/src/test/auto/dom/cases/test_config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var assert = chai.assert;
import { assert } from '/node_modules/chai/chai.js';

/*
* A canary test to ensure our timeout configurations are working correctly for our CI.
Expand Down
2 changes: 1 addition & 1 deletion web/src/test/auto/dom/test_init_check.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// A simple "does device detection work properly" unit test.
// We'll let things break after this reports, since this will likely signal a LOT of other failures.
var assert = chai.assert;
import { assert } from '/node_modules/chai/chai.js';

import Device from '/@keymanapp/keyman/build/engine/device-detect/lib/index.mjs';

Expand Down

0 comments on commit 78dcafe

Please sign in to comment.