Skip to content

Commit

Permalink
test: add smoke test script
Browse files Browse the repository at this point in the history
  • Loading branch information
vladholubiev committed Jun 13, 2019
1 parent c3c0971 commit 2374943
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ unsupported by Tesseract file extensions.

See [compile-tesseract.sh](compile-tesseract.sh) & [compress-with-brotli.sh](compress-with-brotli.sh) files

Smoke test that it works by running `test.sh` script

## See Also

- [aws-lambda-libreoffice](https://github.com/shelfio/aws-lambda-libreoffice)
Expand Down
9 changes: 9 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const {execSync} = require('child_process');
const {getTextFromImage} = require('./src');

module.exports.handler = async () => {
execSync(`cp ./test.png /tmp/test.png`);

return getTextFromImage('/tmp/test.png');
};
Binary file added test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

docker run --rm \
-v "$PWD":/var/task \
lambci/lambda:nodejs8.10 test.handler

0 comments on commit 2374943

Please sign in to comment.