Browse Source

Revert "Cleanup tests"

This reverts commit 46e84ad95d.
pull/288/head
Jerome Wu 6 years ago
parent
commit
a1c851d6c5
  1. 26
      tests/detect.test.js
  2. 29
      tests/recognize.test.js

26
tests/detect.test.js

@ -15,6 +15,32 @@ const getWorker = options => ( @@ -15,6 +15,32 @@ const getWorker = options => (
})
);
before(function cb(done) {
this.timeout(30000);
const load = () => (
loadLang({
lang: 'osd',
cacheMethod: 'write',
...loadLangOptions,
}).then(() => {
done();
})
);
if (typeof startServer !== 'undefined') {
startServer(load);
} else {
load();
}
});
after((done) => {
if (typeof stopServer !== 'undefined') {
stopServer(done);
} else {
done();
}
});
describe('detect()', () => {
it('should detect OSD', (done) => {
[

29
tests/recognize.test.js

@ -22,7 +22,34 @@ const getWorker = options => ( @@ -22,7 +22,34 @@ const getWorker = options => (
})
);
describe('recognize()', () => {
before(function cb(done) {
this.timeout(30000);
const load = () => (
loadLang({
lang: 'eng+chi_tra',
cacheMethod: 'write',
...loadLangOptions,
}).then(() => {
done();
})
);
if (typeof startServer !== 'undefined') {
startServer(load);
} else {
load();
}
});
after((done) => {
if (typeof stopServer !== 'undefined') {
stopServer(done);
} else {
done();
}
});
describe('recognize()',() => {
describe('should recognize different langs', () => {
[
{ name: 'chinese.png', lang: 'chi_tra', ans: CHINESE_TEXT },

Loading…
Cancel
Save