Test integration of initialize() in LMLayer and Worker.

This commit is contained in:
Eddie Antonio Santos 2018-11-30 13:07:50 -07:00
parent 75f0fd41dc
commit fe78283b92
No known key found for this signature in database
GPG key ID: DD411EA4D9509D87

View file

@ -2,10 +2,24 @@ var assert = chai.assert;
describe('LMLayer', function () {
describe('[[constructor]]', function () {
it('should construct with zero arguments', function () {
let lmlayer = new LMLayer();
assert.instanceOf(lmlayer, LMLayer);
it('should construct with zero arguments', function () {
let lmLayer = new LMLayer();
assert.instanceOf(lmLayer, LMLayer);
});
});
describe('#initialize()', function () {
it('should yield a reasonable configuration', function () {
let maxLeftContext = 64;
let lmLayer = new LMLayer();
return lmLayer.initialize(
{ maxLeftContextCodeUnits: maxLeftContext },
{ model: { kind: 'wordlist', words: ['foo', 'bar']} }
).then(function (configuration) {
assert.isAtMost(configuration.leftContextCodeUnits, maxLeftContext);
assert.propertyVal(configuration, 'rightContextCodeUnits', 0);
});
});
});
describe('#asBlobURI()', function () {