Browse Source

Fix tests

feature/aio
Jerome Wu 6 years ago
parent
commit
4f14b4b79c
  1. 3
      scripts/webpack.config.dev.js
  2. 5
      scripts/webpack.config.prod.js
  3. 1
      tests/recognize.test.js

3
scripts/webpack.config.dev.js

@ -31,6 +31,9 @@ module.exports = [
libraryTarget: 'umd', libraryTarget: 'umd',
}), }),
genConfig({ genConfig({
optimization: {
minimize: false,
},
entry: path.resolve(__dirname, '..', 'src', 'index.js'), entry: path.resolve(__dirname, '..', 'src', 'index.js'),
filename: 'tesseract.asm.dev.js', filename: 'tesseract.asm.dev.js',
library: 'Tesseract', library: 'Tesseract',

5
scripts/webpack.config.prod.js

@ -7,7 +7,7 @@ const genConfig = ({
...common, ...common,
...config, ...config,
mode: 'production', mode: 'production',
// devtool: 'source-map', devtool: 'source-map',
entry, entry,
output: { output: {
path: path.resolve(__dirname, '..', 'dist'), path: path.resolve(__dirname, '..', 'dist'),
@ -25,6 +25,9 @@ module.exports = [
libraryTarget: 'umd', libraryTarget: 'umd',
}), }),
genConfig({ genConfig({
optimization: {
minimize: false,
},
entry: path.resolve(__dirname, '..', 'src', 'index.js'), entry: path.resolve(__dirname, '..', 'src', 'index.js'),
filename: 'tesseract.asm.min.js', filename: 'tesseract.asm.min.js',
library: 'Tesseract', library: 'Tesseract',

1
tests/recognize.test.js

@ -1,4 +1,5 @@
const { TesseractWorker } = Tesseract; const { TesseractWorker } = Tesseract;
const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
const IMAGE_PATH = 'http://localhost:3000/tests/assets/images'; const IMAGE_PATH = 'http://localhost:3000/tests/assets/images';
const SIMPLE_TEXT = 'Tesseract.js\n'; const SIMPLE_TEXT = 'Tesseract.js\n';

Loading…
Cancel
Save