fix tests

This commit is contained in:
moos 2020-12-08 20:01:29 -08:00
parent 280bf22ad8
commit 51c412e82e
3 changed files with 6 additions and 7 deletions

View File

@ -224,13 +224,13 @@ function getPOS(text, callback) {
var args = [data];
var matches = uniq(flat(Object.values(data)));
data.rest = diff(words, matches);
profile && args.push(new Date() - start);
nextTick(callback, args);
return data;
}
function error(err) {
console.log('Error >>> ', err);
nextTick(callback, []);
throw err;
}

View File

@ -62,8 +62,7 @@ describe('CLI tests', function() {
it('should get POS', done => {
exec(cmd + '-b get ' + testStr, (error, stdout, stderr) => {
assert.isNull(error);
assert.equal(stdout.trim(),
'bear chased little squirrel \n' +
cmp(stdout, 'bear chased squirrel little \n' +
'angry frightened little \n' +
'bear \n' +
'little');

View File

@ -56,7 +56,7 @@ var str = "The angry bear chased the frightened little squirrel",
verbs: [ 'bear' ],
adjectives: [ 'little', 'angry', 'frightened' ],
adverbs: [ 'little' ],
rest: [ 'The' ]
rest: []
},
garble = 'garblegarble', // expect not to find word
offset = 1285602;