diff --git a/common/core/web/keyboard-processor/src/tsconfig.bundled.json b/common/core/web/keyboard-processor/src/tsconfig.bundled.json new file mode 100644 index 00000000000..8a219c00d60 --- /dev/null +++ b/common/core/web/keyboard-processor/src/tsconfig.bundled.json @@ -0,0 +1,15 @@ +{ + // This variant of the tsconfig.json exists to create a 'leaf', 'bundled' + // version of the keyboard-processor build product. The same reference + // cannot be prepended twice in a composite tsc build, posing problems + // for certain down-line builds if the two tsconfigs are not differentiated. + "extends": "./tsconfig.json", + "compilerOptions": { + "outFile": "../build/index.bundled.js" + }, + "references": [ + { "path": "../../../../../common/models/types" }, + { "path": "../../../../../common/web/web-environment/", "prepend": true }, + { "path": "../../../../../common/core/web/utils/", "prepend": true} + ] +} diff --git a/common/core/web/keyboard-processor/test.sh b/common/core/web/keyboard-processor/test.sh index dafcd554df3..b660fca0cfd 100755 --- a/common/core/web/keyboard-processor/test.sh +++ b/common/core/web/keyboard-processor/test.sh @@ -55,43 +55,16 @@ test-headless ( ) { FLAGS="$FLAGS --reporter mocha-teamcity-reporter" fi - # Poor Man's Modules until we support ES6 throughout - PREPEND=./tests/cases/prepend.js - rm -f $PREPEND - for n in tests/cases/*.js; do - echo $n - (cat ../../../web/web-environment/build/index.js; echo) > $PREPEND - (cat ../utils/build/index.js; echo) >> $PREPEND - (cat ../tools/recorder/build/nodeProctor/index.js; echo) >> $PREPEND - (cat ../keyboard-processor/build/index.js; echo) >> $PREPEND - (cat $n; echo) >> $PREPEND; - npm run mocha -- --recursive $FLAGS $PREPEND || die - rm $PREPEND - done - - # Poor Man's Modules until we support ES6 throughout - PREPEND=./tests/cases/engine/prepend.js - rm -f $PREPEND - for n in tests/cases/engine/*.js; do - echo $n - (cat ../../../web/web-environment/build/index.js; echo) > $PREPEND - (cat ../utils/build/index.js; echo) >> $PREPEND - (cat ../tools/recorder/build/nodeProctor/index.js; echo) >> $PREPEND - (cat ../keyboard-processor/build/index.js; echo) >> $PREPEND - (cat $n; echo) >> $PREPEND; - npm run mocha -- --recursive $FLAGS $PREPEND || die - rm $PREPEND - done - - # npm run mocha -- --recursive $FLAGS ./tests/cases/ + npm run mocha -- --recursive $FLAGS ./tests/cases/ } -if [ $FETCH_DEPS = true ]; then - # Build test dependency - pushd "$KEYMAN_ROOT/common/core/web/tools/recorder/src" - ./build.sh -skip-package-install || fail "recorder-core compilation failed." - popd -fi +# Build test dependency +pushd "$KEYMAN_ROOT/common/core/web/tools/recorder/src" +./build.sh -skip-package-install || fail "recorder-core compilation failed." +popd + +# Compile web's `keyboard-processor` module." +npm run tsc -- -b src/tsconfig.bundled.json || fail "Failed to compile the testing version of the core/web/keyboard-processor module." # Run headless (browserless) tests. echo_heading "Running Keyboard Processor test suite" diff --git a/common/core/web/keyboard-processor/tests/cases/basic-engine.js b/common/core/web/keyboard-processor/tests/cases/basic-engine.js index 809d110d5c1..bbbe2bf28cb 100644 --- a/common/core/web/keyboard-processor/tests/cases/basic-engine.js +++ b/common/core/web/keyboard-processor/tests/cases/basic-engine.js @@ -2,11 +2,11 @@ var assert = require('chai').assert; let fs = require('fs'); let vm = require('vm'); -let KeyboardProcessor = com.keyman.text.KeyboardProcessor; -global.keyman = {}; +let KeyboardProcessor = require('../../build/index.bundled.js'); +let KMWRecorder = require('../../../tools/recorder/dist/nodeProctor'); -// Initialize supplementary plane string extensions -String.kmwEnableSupplementaryPlane(false); +// Required initialization setup. +global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. describe('Engine - Basic Simulation', function() { let testJSONtext = fs.readFileSync('../tests/resources/json/engine_tests/basic_lao_simulation.json'); @@ -41,7 +41,7 @@ describe('Engine - Basic Simulation', function() { // Converts each test set into its own Mocha-level test. for(let set of testSuite.inputTestSets) { let proctor = new KMWRecorder.NodeProctor(keyboard, device, assert.equal); - + if(!proctor.compatibleWithSuite(testSuite)) { it.skip(set.toTestName() + " - Cannot run this test suite on Node."); } else { diff --git a/common/core/web/keyboard-processor/tests/cases/basic-init.js b/common/core/web/keyboard-processor/tests/cases/basic-init.js index a7891043628..873ca7df445 100644 --- a/common/core/web/keyboard-processor/tests/cases/basic-init.js +++ b/common/core/web/keyboard-processor/tests/cases/basic-init.js @@ -2,12 +2,15 @@ var assert = require('chai').assert; var fs = require("fs"); var vm = require("vm"); -let KeyboardProcessor = com.keyman.text.KeyboardProcessor; -global.keyman = {}; -global.com = com; +let KeyboardProcessor = require('../../build/index.bundled.js'); + +// Required initialization setup. +global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. +global.keyman = {}; // So that keyboard-based checks against the global `keyman` succeed. + // 10.0+ dependent keyboards, like khmer_angkor, will otherwise fail to load. // Initialize supplementary plane string extensions -String.kmwEnableSupplementaryPlane(false); +String.kmwEnableSupplementaryPlane(false); // Test the KeyboardProcessor interface. describe('KeyboardProcessor', function() { diff --git a/common/core/web/keyboard-processor/tests/cases/chirality.js b/common/core/web/keyboard-processor/tests/cases/chirality.js index c6406c99281..6573bfdd6a2 100644 --- a/common/core/web/keyboard-processor/tests/cases/chirality.js +++ b/common/core/web/keyboard-processor/tests/cases/chirality.js @@ -2,11 +2,11 @@ var assert = require('chai').assert; let fs = require('fs'); let vm = require('vm'); -let KeyboardProcessor = com.keyman.text.KeyboardProcessor; -global.keyman = {}; +let KeyboardProcessor = require('../../build/index.bundled.js'); +let KMWRecorder = require('../../../tools/recorder/dist/nodeProctor'); -// Initialize supplementary plane string extensions -String.kmwEnableSupplementaryPlane(false); +// Required initialization setup. +global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. describe('Engine - Chirality', function() { let testJSONtext = fs.readFileSync('../tests/resources/json/engine_tests/chirality.json'); @@ -41,7 +41,7 @@ describe('Engine - Chirality', function() { // Converts each test set into its own Mocha-level test. for(let set of testSuite.inputTestSets) { let proctor = new KMWRecorder.NodeProctor(keyboard, device, assert.equal); - + if(!proctor.compatibleWithSuite(testSuite)) { it.skip(set.toTestName() + " - Cannot run this test suite on Node."); } else if(set.constraint.target == 'hardware') { diff --git a/common/core/web/keyboard-processor/tests/cases/deadkeys.js b/common/core/web/keyboard-processor/tests/cases/deadkeys.js index 939b7040980..adbeb67053d 100644 --- a/common/core/web/keyboard-processor/tests/cases/deadkeys.js +++ b/common/core/web/keyboard-processor/tests/cases/deadkeys.js @@ -2,12 +2,11 @@ var assert = require('chai').assert; let fs = require('fs'); let vm = require('vm'); -let KeyboardProcessor = com.keyman.text.KeyboardProcessor; -global.keyman = {}; -global.com = com; +let KeyboardProcessor = require('../../build/index.bundled.js'); +let KMWRecorder = require('../../../tools/recorder/dist/nodeProctor'); -// Initialize supplementary plane string extensions -String.kmwEnableSupplementaryPlane(false); +// Required initialization setup. +global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. describe('Engine - Deadkeys', function() { let testJSONtext = fs.readFileSync('../tests/resources/json/engine_tests/deadkeys.json'); @@ -42,7 +41,7 @@ describe('Engine - Deadkeys', function() { // Converts each test set into its own Mocha-level test. for(let set of testSuite.inputTestSets) { let proctor = new KMWRecorder.NodeProctor(keyboard, device, assert.equal); - + if(!proctor.compatibleWithSuite(testSuite)) { it.skip(set.toTestName() + " - Cannot run this test suite on Node."); } else { diff --git a/common/core/web/keyboard-processor/tests/cases/engine/context.js b/common/core/web/keyboard-processor/tests/cases/engine/context.js index 65bc4336f21..4ca722decee 100644 --- a/common/core/web/keyboard-processor/tests/cases/engine/context.js +++ b/common/core/web/keyboard-processor/tests/cases/engine/context.js @@ -2,26 +2,22 @@ var assert = require('chai').assert; let fs = require('fs'); let vm = require('vm'); -let KeyboardProcessor = com.keyman.text.KeyboardProcessor; -global.keyman = {}; -global.com = com; +let KeyboardProcessor = require('../../../build/index.bundled.js'); +let KMWRecorder = require('../../../../tools/recorder/dist/nodeProctor'); -// Initialize supplementary plane string extensions -String.kmwEnableSupplementaryPlane(false); - -/* +/* * ABOUT THIS TEST SUITE * --------------------- - * + * * This suite contains two types of tests, both designed to test all possible variations * of behaviors that `KeyboardInterface.fullContextMatch` may be expected to handle. - * + * * Type 1: White-box tests for validity of the generated context-cache * - uses only the `baseSequence` of each test spec definition; does not * use any `fullMatchDefs` entries. * - uses the specified `contextCache` entry of each test spec in assertions * - CTRL+F `Tests "stage 1" of fullContextMatch` for more details. - * + * * Type 2: Black-box rule-matching tests * - uses both `baseSequence` and `fullMatchDefs` entries of a test spec * - tests that each simulation sequence's output either passes or fails against @@ -30,6 +26,9 @@ String.kmwEnableSupplementaryPlane(false); * It should be a removable limitation, though. */ +// Required initialization setup. +global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. + let device = { formFactor: 'desktop', OS: 'windows', @@ -68,14 +67,13 @@ function runEngineRuleSet(ruleSet, defaultNoun) { ruleSeq.test(proctor, target); // Now for the real test! - let processor = new KeyboardProcessor(); - processor.device = device; + let processor = new KeyboardProcessor(device); processor.activeKeyboard = keyboard; var res = processor.keyboardInterface.fullContextMatch(ruleDef.n, target, ruleDef.rule); var msg = matchTest.msg; if(!msg) { - msg = defaultNoun + " incorrectly reported as " + (matchTest.result ? "unmatched!" : "matched!"); + msg = defaultNoun + " incorrectly reported as " + (matchTest.result ? "unmatched!" : "matched!"); } assert.equal(res, matchTest.result, msg); } @@ -465,7 +463,7 @@ var ANY_CONTEXT_TEST_2 = { * * store(ac) 'ac' * store(bc) 'bc' - * + * * 'c' any(ac) any(bc) context(3) context(2) > 'success' */ var ANY_CONTEXT_TEST_3 = { @@ -522,7 +520,7 @@ var ANY_CONTEXT_TEST_3 = { * * store(ab) 'ab' * store(bc) 'bc' - * + * * 'c' any(ab) index(bc, 2) 'a' > 'success' */ var ANY_INDEX_TEST_1 = { @@ -569,7 +567,7 @@ var ANY_INDEX_TEST_1 = { * * store(ab) 'ab' * store(bc) 'bc' - * + * * 'c' any(ab) index(bc, 2) index(bc, 2) index(ab, 2) > 'success' */ var ANY_INDEX_TEST_2 = { @@ -616,7 +614,7 @@ var ANY_INDEX_TEST_2 = { * * store(ab) 'ab' * store(bc) 'bc' - * + * * 'c' any(ab) any(bc) index(bc, 3) index(ab, 2) > 'success' */ var ANY_INDEX_TEST_3 = { @@ -749,7 +747,7 @@ var DEADKEY_STORE_TEST_2 = { * * store(match) dk(0) dk(1) dk(2) * store(abc) 'abc' - * + * * any(match) index(abc, 1) > 'success' */ var DEADKEY_STORE_TEST_3 = { @@ -882,7 +880,7 @@ var NOTANY_NUL_TEST_1 = { * * store(match) dk(0) dk(1) dk(2) * store(abc) 'abc' - * + * * notany(match) any(abc) > 'success' */ var NOTANY_NUL_TEST_2 = { @@ -919,7 +917,7 @@ var NOTANY_NUL_TEST_2 = { * * store(first) dk(0) 'b' dk(2) * store(second) 'a' dk(1) 'c' - * + * * notany(first) any(second) > 'success' */ var NOTANY_NUL_TEST_3 = { @@ -966,8 +964,8 @@ var NOTANY_NUL_TEST_3 = { }] }; -var DEADKEY_RULE_SET = [ DEADKEY_TEST_1, DEADKEY_TEST_2, DEADKEY_TEST_3, DEADKEY_TEST_4, - DEADKEY_TEST_5, DEADKEY_TEST_6 +var DEADKEY_RULE_SET = [ DEADKEY_TEST_1, DEADKEY_TEST_2, DEADKEY_TEST_3, DEADKEY_TEST_4, + DEADKEY_TEST_5, DEADKEY_TEST_6 ]; var ANY_CONTEXT_RULE_SET = [ ANY_CONTEXT_TEST_1, ANY_CONTEXT_TEST_2, ANY_CONTEXT_TEST_3 ]; var ANY_INDEX_RULE_SET = [ ANY_INDEX_TEST_1, ANY_INDEX_TEST_2, ANY_INDEX_TEST_3 ]; @@ -983,7 +981,7 @@ var NOTANY_NUL_RULE_SET = [ NOTANY_NUL_TEST_1, NOTANY_NUL_TEST_2, NOTANY_NUL_TES describe('Engine - Context Matching', function() { before(function() { - let kp = new KeyboardProcessor(); + let kp = new KeyboardProcessor(device); // These two lines will load a keyboard from its file; headless-mode `registerKeyboard` will // automatically set the keyboard as active. @@ -1008,8 +1006,7 @@ describe('Engine - Context Matching', function() { ruleSeq.test(proctor, target); // Now for the real test! - let processor = new KeyboardProcessor(); - processor.device = device; + let processor = new KeyboardProcessor(device); processor.activeKeyboard = keyboard; var res = processor.keyboardInterface._BuildExtendedContext(ruleDef.n, ruleDef.ln, target); @@ -1070,7 +1067,7 @@ describe('Engine - Context Matching', function() { runEngineRuleSet([ANY_INDEX_TEST_3]); }); }); - + describe('handles interactions with deadkeys in stores', function() { it('for any on pure deadkey store: DEADKEY_STORE_TEST_1', function() { runEngineRuleSet([DEADKEY_STORE_TEST_1]); diff --git a/common/core/web/keyboard-processor/tests/cases/engine/notany_context.js b/common/core/web/keyboard-processor/tests/cases/engine/notany_context.js index 7db2d05feed..550ec049521 100644 --- a/common/core/web/keyboard-processor/tests/cases/engine/notany_context.js +++ b/common/core/web/keyboard-processor/tests/cases/engine/notany_context.js @@ -2,11 +2,16 @@ const assert = require('chai').assert; const fs = require('fs'); const vm = require('vm'); -let KeyboardProcessor = com.keyman.text.KeyboardProcessor; -global.keyman = {}; +let KeyboardProcessor = require('../../../build/index.bundled.js'); +const KMWRecorder = require('../../../../tools/recorder/dist/nodeProctor'); + +// Required initialization setup. +global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. +global.keyman = {}; // So that keyboard-based checks against the global `keyman` succeed. + // 10.0+ dependent keyboards, like khmer_angkor, will otherwise fail to load. // Initialize supplementary plane string extensions -String.kmwEnableSupplementaryPlane(false); +String.kmwEnableSupplementaryPlane(false); const device = { formFactor: 'desktop', @@ -27,7 +32,7 @@ function runEngineRuleSet(ruleSet) { } /** - * Wrapper to simplify running tests -- supports either virtual key codes as string (e.g. 'A' is VK_A) + * Wrapper to simplify running tests -- supports either virtual key codes as string (e.g. 'A' is VK_A) * or an array of integers. Does not currently support modifiers (not needed here). * @param {String|Array} input Virtual key codes of each character (as string or array) * @param {String} output Expected output @@ -35,11 +40,11 @@ function runEngineRuleSet(ruleSet) { function runStringRuleSet(input, output) { const rule = { - "inputs": + "inputs": typeof input == 'string' - ? input.split("").map(ch => + ? input.split("").map(ch => { return { "type": "key", "keyCode": ch.charCodeAt(0), "states": 10752, "modifiers": 0, "modifierChanged": false, "isVirtualKey": true } }) - : input.map(ch => + : input.map(ch => { return { "type": "key", "keyCode": ch, "states": 10752, "modifiers": 0, "modifierChanged": false, "isVirtualKey": true } }), "output": output }; diff --git a/common/core/web/keyboard-processor/tests/cases/engine/stores.js b/common/core/web/keyboard-processor/tests/cases/engine/stores.js index 4b14748c20e..dcb142829dd 100644 --- a/common/core/web/keyboard-processor/tests/cases/engine/stores.js +++ b/common/core/web/keyboard-processor/tests/cases/engine/stores.js @@ -2,11 +2,11 @@ var assert = require('chai').assert; let fs = require('fs'); let vm = require('vm'); -let KeyboardProcessor = com.keyman.text.KeyboardProcessor; -global.keyman = {}; +let KeyboardProcessor = require('../../../build/index.bundled.js'); +let KMWRecorder = require('../../../../tools/recorder/dist/nodeProctor'); -// Initialize supplementary plane string extensions -String.kmwEnableSupplementaryPlane(false); +// Required initialization setup. +global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. let device = { formFactor: 'desktop', @@ -18,27 +18,26 @@ describe('Engine - Stores', function() { var toSupplementaryPairString = function(code){ var H = Math.floor((code - 0x10000) / 0x400) + 0xD800; var L = (code - 0x10000) % 0x400 + 0xDC00; - + return String.fromCharCode(H, L); } it('Store \'Explosion\'', function() { - let processor = new KeyboardProcessor(); - processor.device = device; + let processor = new KeyboardProcessor(device); // A 'hollow' Keyboard that only follows default rules. That said, we need a Keyboard // instance to host cache data for our exploded store tests. processor.activeKeyboard = new com.keyman.keyboards.Keyboard(); // Function defined at top of file; creates supplementary pairs for extended Unicode codepoints. var u = toSupplementaryPairString; - + var STORES = [ {smp: false, in: "apple", out: ['a','p','p','l','e']}, //In JS-escaped form: "\\ud804\\udd12\\ud804\\udd0d\\ud804\\udd0f\\ud804\\udd10\\ud804\\udd0a\\ud804\\udd05" //(Supplementary pairs, copied from the easy_chakma keyboard.) {smp: true, in: "𑄒𑄍𑄏𑄐𑄊𑄅", out: ["𑄒","𑄍","𑄏","𑄐","𑄊","𑄅"]}, // Built in-line via function. Looks functionally equivalent to "apple", but with SMP characters. - {smp: true, in: (u(0x1d5ba)+u(0x1d5c9)+u(0x1d5c9)+u(0x1d5c5)+u(0x1d5be)), + {smp: true, in: (u(0x1d5ba)+u(0x1d5c9)+u(0x1d5c9)+u(0x1d5c5)+u(0x1d5be)), out: [u(0x1d5ba), u(0x1d5c9), u(0x1d5c9), u(0x1d5c5), u(0x1d5be)]} ]; diff --git a/common/core/web/keyboard-processor/tests/cases/engine/unmatched_final_group.js b/common/core/web/keyboard-processor/tests/cases/engine/unmatched_final_group.js index 30d126fcc53..802a743566e 100644 --- a/common/core/web/keyboard-processor/tests/cases/engine/unmatched_final_group.js +++ b/common/core/web/keyboard-processor/tests/cases/engine/unmatched_final_group.js @@ -2,11 +2,11 @@ var assert = require('chai').assert; let fs = require('fs'); let vm = require('vm'); -let KeyboardProcessor = com.keyman.text.KeyboardProcessor; -global.keyman = {}; +let KeyboardProcessor = require('../../../build/index.bundled.js'); +let KMWRecorder = require('../../../../tools/recorder/dist/nodeProctor'); -// Initialize supplementary plane string extensions -String.kmwEnableSupplementaryPlane(false); +// Required initialization setup. +global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. describe('Engine - Unmatched Final Groups', function() { let testJSONtext = fs.readFileSync('../tests/resources/json/engine_tests/ghp_enter.json'); diff --git a/common/core/web/keyboard-processor/tests/cases/transcriptions.js b/common/core/web/keyboard-processor/tests/cases/transcriptions.js index c351ded8d0e..ecd664db787 100644 --- a/common/core/web/keyboard-processor/tests/cases/transcriptions.js +++ b/common/core/web/keyboard-processor/tests/cases/transcriptions.js @@ -1,15 +1,16 @@ var assert = require('chai').assert; +let KeyboardProcessor = require('../../build/index.bundled.js'); -global.keyman = {}; +// Required initialization setup. +global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. -// Initialize supplementary plane string extensions String.kmwEnableSupplementaryPlane(false); describe("Transcriptions and Transforms", function() { var toSupplementaryPairString = function(code){ var H = Math.floor((code - 0x10000) / 0x400) + 0xD800; var L = (code - 0x10000) % 0x400 + 0xDC00; - + return String.fromCharCode(H, L); } @@ -49,7 +50,7 @@ describe("Transcriptions and Transforms", function() { * Other modules coming later will need it, though. */ var transcription = target.buildTranscriptionFrom(original, null); - + assert.equal(transcription.transform.insert, "s", "Failed to recognize inserted text"); assert.equal(transcription.transform.deleteLeft, 0, "Incorrectly detected left-of-caret deletions"); assert.equal(transcription.transform.deleteRight, 0, "Incorrectly detected right-of-caret deletions"); @@ -321,11 +322,11 @@ but not himself.`; // Sheev Palpatine, in the Star Wars prequels. // could eventually run in 'headless' mode. var target = new Mock("apple"); var original = Mock.from(target); - + target.setDeadkeyCaret(4); target.insertDeadkeyBeforeCaret(0); target.setDeadkeyCaret(1); - target.insertDeadkeyBeforeCaret(1); + target.insertDeadkeyBeforeCaret(1); target.setDeadkeyCaret(2); target.insertDeadkeyBeforeCaret(2); // 'a' dk(1) 'p' dk(2) | 'p' 'l' dk(0) 'e' @@ -336,8 +337,8 @@ but not himself.`; // Sheev Palpatine, in the Star Wars prequels. target.setDeadkeyCaret(3); target.deleteCharsBeforeCaret(2); - target.insertTextBeforeCaret("b"); - target.insertDeadkeyBeforeCaret(3); // In effect: 'a' dk(1) 'b' dk(3) | 'l' dk(0) 'e' + target.insertTextBeforeCaret("b"); + target.insertDeadkeyBeforeCaret(3); // In effect: 'a' dk(1) 'b' dk(3) | 'l' dk(0) 'e' var transcription = target.buildTranscriptionFrom(original, null); @@ -349,7 +350,7 @@ but not himself.`; // Sheev Palpatine, in the Star Wars prequels. var rem = transcription.removedDks; assert.equal(rem.length, 1, "Incorrect count for removed deadkeys"); assert.deepEqual({d: rem[0].d, p: rem[0].p}, {d: 2, p: 2}, "Selected wrong deadkey as removed"); - + var ins = transcription.insertedDks; assert.equal(ins.length, 1, "Incorrect count for inserted deadkeys"); assert.deepEqual({d: ins[0].d, p: ins[0].p}, {d: 3, p:2}, "Selected wrong deadkey as inserted"); diff --git a/common/core/web/keyboard-processor/tests/cases/versions.js b/common/core/web/keyboard-processor/tests/cases/versions.js index e3c6a42768e..cebd11a50a5 100644 --- a/common/core/web/keyboard-processor/tests/cases/versions.js +++ b/common/core/web/keyboard-processor/tests/cases/versions.js @@ -1,9 +1,8 @@ var assert = require('chai').assert; +let KeyboardProcessor = require('../../build/index.bundled.js'); -global.keyman = {}; - -// Initialize supplementary plane string extensions -String.kmwEnableSupplementaryPlane(false); +// Required initialization setup. +global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. describe('Version Logic', function() { it('Should provide a default, fallback value when nothing is specified', function() { @@ -43,5 +42,5 @@ describe('Version Logic', function() { // Ensures the first "precede" check's return is flipped when the order's flipped. assert.equal(v9_1_0.compareTo(v9_0_1), 1); }); - + }); \ No newline at end of file