Browse Source

Fixed unit tests

dev/v4
Balearica 2 years ago
parent
commit
32c5c14e53
  1. 2
      tests/detect.test.js
  2. 2
      tests/recognize.test.js

2
tests/detect.test.js

@ -24,7 +24,7 @@ describe('detect()', async () => { @@ -24,7 +24,7 @@ describe('detect()', async () => {
[
{ name: 'cosmic.png', ans: { script: 'Latin' } },
].forEach(async ({ name, ans: { script } }) => {
const { data: { script: s } } = await Tesseract.detect(`${IMAGE_PATH}/${name}`);
const { data: { script: s } } = await Tesseract.detect(`${IMAGE_PATH}/${name}`, undefined, OPTIONS);
expect(s).to.be(script);
});
}).timeout(TIMEOUT);

2
tests/recognize.test.js

@ -36,7 +36,7 @@ describe('recognize()', () => { @@ -36,7 +36,7 @@ describe('recognize()', () => {
{ format: 'jpg', image: SIMPLE_JPG_BASE64, ans: SIMPLE_TEXT },
].forEach(({ format, image, ans }) => (
it(`recongize ${format} in base64`, async () => {
const { data: { text } } = await Tesseract.recognize(image);
const { data: { text } } = await Tesseract.recognize(image, undefined, OPTIONS);
expect(text).to.be(ans);
}).timeout(TIMEOUT)
));

Loading…
Cancel
Save