From 51c412e82e0387f2c20916c33842f9cc2580abad Mon Sep 17 00:00:00 2001 From: moos Date: Tue, 8 Dec 2020 20:01:29 -0800 Subject: [PATCH] fix tests --- src/common.js | 2 +- test/cli_test.js | 9 ++++----- test/wordpos_test.js | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/common.js b/src/common.js index 066dab4..ab01815 100644 --- a/src/common.js +++ b/src/common.js @@ -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; } diff --git a/test/cli_test.js b/test/cli_test.js index e34a3f6..1d473a8 100644 --- a/test/cli_test.js +++ b/test/cli_test.js @@ -62,11 +62,10 @@ 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' + - 'angry frightened little \n' + - 'bear \n' + - 'little'); + cmp(stdout, 'bear chased squirrel little \n' + + 'angry frightened little \n' + + 'bear \n' + + 'little'); done(); }); }); diff --git a/test/wordpos_test.js b/test/wordpos_test.js index 21be423..12bd396 100644 --- a/test/wordpos_test.js +++ b/test/wordpos_test.js @@ -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;