mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-13 11:07:42 +00:00
test(common/lmlayer): use import syntax in tests
This commit is contained in:
parent
0b4193d942
commit
fbead6cd07
3 changed files with 11 additions and 3 deletions
|
|
@ -4,6 +4,12 @@
|
|||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@types/chai": {
|
||||
"version": "4.2.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.11.tgz",
|
||||
"integrity": "sha512-t7uW6eFafjO+qJ3BIV2gGUyZs27egcNRkUdalkud+Qa3+kg//f129iuOFivHDXQ+vnU3fDXuwgv0cqMCbcE8sw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/mocha": {
|
||||
"version": "7.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz",
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@keymanapp/lexical-model-types": "^14.0.75",
|
||||
"@types/chai": "^4.2.11",
|
||||
"@types/mocha": "^7.0.2",
|
||||
"chai": "^4.2.0",
|
||||
"mocha": "^5.2.0",
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
/// <reference types="@keymanapp/lexical-model-types" />
|
||||
|
||||
var assert = require('chai').assert;
|
||||
var breakASCIIWords = require('../').ascii;
|
||||
import {assert} from 'chai';
|
||||
import {ascii as breakASCIIWords} from '../'
|
||||
|
||||
|
||||
describe('The ASCII word breaker', function () {
|
||||
it('should break simple English sentences', function () {
|
||||
let breaks: Span[] = breakASCIIWords('Look! -- The quick brown fox jumps... over the lazy dog!');
|
||||
let breaks = breakASCIIWords('Look! -- The quick brown fox jumps... over the lazy dog!');
|
||||
let words = breaks.map(span => span.text);
|
||||
assert.deepEqual(words, ['Look', 'The', 'quick', 'brown', 'fox', 'jumps', 'over', 'the', 'lazy', 'dog']);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue