From bc51e340cb5786d0fb17262174a176644390b993 Mon Sep 17 00:00:00 2001 From: Jerome Wu Date: Tue, 2 Jul 2019 20:59:03 +0800 Subject: [PATCH] Reorder test cases --- tests/recognize.test.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/recognize.test.js b/tests/recognize.test.js index a53f0f7..3bd4dac 100644 --- a/tests/recognize.test.js +++ b/tests/recognize.test.js @@ -25,24 +25,6 @@ const getWorker = options => ( ); describe('recognize()', () => { - describe('should recognize base64 image', () => { - [ - { format: 'png', image: SIMPLE_PNG, ans: SIMPLE_TEXT }, - { format: 'jpg', image: SIMPLE_JPG, ans: SIMPLE_TEXT }, - ].forEach(({ format, image, ans }) => ( - it(`recongize ${format} in base64`, (done) => { - const worker = getWorker(); - worker - .recognize(image) - .then(({ text }) => { - expect(text).to.be(ans); - worker.terminate(); - done(); - }); - }).timeout(30000) - )); - }); - describe('should recognize different langs', () => { [ { name: 'chinese.png', lang: 'chi_tra', ans: CHINESE_TEXT }, @@ -136,6 +118,24 @@ describe('recognize()', () => { )); }); + describe('should recognize base64 image', () => { + [ + { format: 'png', image: SIMPLE_PNG, ans: SIMPLE_TEXT }, + { format: 'jpg', image: SIMPLE_JPG, ans: SIMPLE_TEXT }, + ].forEach(({ format, image, ans }) => ( + it(`recongize ${format} in base64`, (done) => { + const worker = getWorker(); + worker + .recognize(image) + .then(({ text }) => { + expect(text).to.be(ans); + worker.terminate(); + done(); + }); + }).timeout(30000) + )); + }); + (isBrowser ? describe.skip : describe)('should recognize image in Buffer (Node.js only)', () => { FORMATS.forEach(format => ( it(`support ${format} format`, (done) => {