mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-26 01:27:42 +00:00
fix(common/web): re-establishes one headless gesture-recognizer test suite
This commit is contained in:
parent
296adf08b4
commit
1efc09d4e6
11 changed files with 17 additions and 19 deletions
|
|
@ -37,5 +37,6 @@
|
|||
"dependencies": {
|
||||
"eventemitter3": "^4.0.0"
|
||||
},
|
||||
"main": "./build/obj/index.js"
|
||||
"main": "./build/obj/index.js",
|
||||
"type": "module"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { EventEmitter } from "eventemitter3";
|
||||
import EventEmitter from "eventemitter3";
|
||||
import { GestureRecognizerConfiguration } from "./gestureRecognizerConfiguration.js";
|
||||
import { MouseEventEngine } from "./mouseEventEngine.js";
|
||||
import { Mutable } from "./mutable.js";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { EventEmitter } from "eventemitter3";
|
||||
import EventEmitter from "eventemitter3";
|
||||
import { GestureRecognizerConfiguration } from "./gestureRecognizerConfiguration.js";
|
||||
import { InputSample } from "./inputSample.js";
|
||||
import { Nonoptional } from "./nonoptional.js";
|
||||
|
|
|
|||
|
|
@ -1,17 +1,14 @@
|
|||
const assert = require('chai').assert;
|
||||
const sinon = require('sinon');
|
||||
import { assert } from 'chai'
|
||||
import sinon from 'sinon';
|
||||
|
||||
const PromiseStatusModule = require('promise-status-async');
|
||||
import * as PromiseStatusModule from 'promise-status-async';
|
||||
const promiseStatus = PromiseStatusModule.promiseStatus;
|
||||
const PromiseStatuses = PromiseStatusModule.PromiseStatuses;
|
||||
|
||||
const GestureRecognizer = require('../../../../build/index.js');
|
||||
const com = GestureRecognizer.com;
|
||||
const PathSegmenter = com.keyman.osk.PathSegmenter;
|
||||
import { PathSegmenter } from '@keymanapp/gesture-recognizer';
|
||||
import { timedPromise } from '../../../../build/tools/index.js';
|
||||
|
||||
const timedPromise = require('../../../../build/tools/unit-test-resources.js').timedPromise;
|
||||
|
||||
describe("Basic segmentation cases", function() {
|
||||
describe.only("Basic segmentation cases", function() {
|
||||
describe("Single-sample 'sequence'", function() {
|
||||
it("expected segment types", function() {
|
||||
let spy = sinon.fake();
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ if builder_start_action build :recorder; then
|
|||
# Thanks to https://stackoverflow.com/a/10107668 for this tidbit.
|
||||
# Searches for FIXTURE_TARGET above and replaces it with the actual fixture!
|
||||
pushd recorder >/dev/null
|
||||
node update-index.js build/index.html
|
||||
node update-index.cjs build/index.html
|
||||
popd >/dev/null
|
||||
builder_finish_action success build :recorder
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@ set -eu
|
|||
THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")"
|
||||
cd $(dirname "$THIS_SCRIPT")
|
||||
|
||||
# On Windows, `node extractor.js` cannot be directly piped; that requires `node.exe`.
|
||||
# On Windows, `node extractor.cjs` cannot be directly piped; that requires `node.exe`.
|
||||
# But that doesn't make sense on other platforms, so... wrapper script.
|
||||
node extractor.js
|
||||
node extractor.cjs
|
||||
|
|
@ -12,7 +12,7 @@ fs.readFile('src/index.html', 'utf8', function(err, text) {
|
|||
}
|
||||
|
||||
// Runs the fixture-extractor script, receives the fixture's raw HTML.
|
||||
let buf = child_process.execSync("node extractor.js", {cwd: "../host-fixture", windowsHide: true, shell: true}).toString();
|
||||
let buf = child_process.execSync("node extractor.cjs", {cwd: "../host-fixture", windowsHide: true, shell: true}).toString();
|
||||
|
||||
let INSERTION_POINT = " <!--INSERT_FIXTURE-->" + os.EOL;
|
||||
text = text.replace(INSERTION_POINT, buf);
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { EventEmitter } from 'eventemitter3';
|
||||
import EventEmitter from 'eventemitter3';
|
||||
import { GestureRecognizer } from '@keymanapp/gesture-recognizer';
|
||||
|
||||
import { FixtureLayoutConfiguration } from './fixtureLayoutConfiguration.js';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { EventEmitter } from "eventemitter3";
|
||||
import EventEmitter from "eventemitter3";
|
||||
import { JSONTrackedPoint, TrackedPoint } from "./trackedPoint.js";
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { EventEmitter } from "eventemitter3";
|
||||
import EventEmitter from "eventemitter3";
|
||||
import { InputSample } from "./inputSample.js";
|
||||
import { PathSegmenter } from "./pathSegmenter.js";
|
||||
import { Segment } from "./segment.js";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue