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) => {