You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
819 B
30 lines
819 B
2 years ago
|
// const { createWorker } = Tesseract;
|
||
|
// const worker = createWorker(OPTIONS);
|
||
|
// before(function cb() {
|
||
|
// this.timeout(0);
|
||
|
// return worker.load();
|
||
|
// });
|
||
|
|
||
|
|
||
|
(IS_BROWSER ? describe : describe.skip)('Invalid paths should result in promise rejection', () => {
|
||
|
it('Invalid workerPath', async () => {
|
||
|
const OPTIONS1 = JSON.parse(JSON.stringify(OPTIONS));
|
||
|
OPTIONS1.corePath = "badpath.js";
|
||
|
let errorThrown;
|
||
|
try {
|
||
|
const worker = Tesseract.createWorker(OPTIONS1);
|
||
|
await worker.load()
|
||
|
errorThrown = false;
|
||
|
} catch (error) {
|
||
|
errorThrown = true;
|
||
|
}
|
||
|
|
||
|
expect(errorThrown).to.equal(true);
|
||
|
|
||
|
// expect(func).to.throwError();
|
||
|
|
||
|
// const ret = await (worker.load().then(() => true).catch(() => false));
|
||
|
// expect(ret).to.equal(false);
|
||
|
}).timeout(TIMEOUT);
|
||
|
});
|