test(common/lmlayer): use import syntax in tests

This commit is contained in:
Eddie Antonio Santos 2020-05-13 10:29:24 -06:00
parent 0b4193d942
commit fbead6cd07
No known key found for this signature in database
GPG key ID: DD411EA4D9509D87
3 changed files with 11 additions and 3 deletions

View file

@ -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",

View file

@ -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",

View file

@ -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']);
});