Browse Source

Cleanup tests

feature/aio
Jerome Wu 6 years ago
parent
commit
46e84ad95d
  1. 26
      tests/detect.test.js
  2. 27
      tests/recognize.test.js

26
tests/detect.test.js

@ -15,32 +15,6 @@ const getWorker = options => ( @@ -15,32 +15,6 @@ 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) => {
[

27
tests/recognize.test.js

@ -22,34 +22,7 @@ const getWorker = options => ( @@ -22,34 +22,7 @@ const getWorker = options => (
})
);
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