Skip to content

Commit b27b231

Browse files
committed
Add better test
1 parent 63e79ed commit b27b231

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
!package-lock.json
33
!package.json
44
!webpack.config.js
5+
!test.js

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ RUN npm --no-optional --no-audit --progress=false install
1212

1313
RUN node ./node_modules/webpack/bin/webpack.js
1414

15-
RUN node -e "console.log(require('sharp'))"
15+
RUN node ./test.js || (echo 'Test failed'; exit 1)
1616

1717
RUN mkdir /dist && \
1818
echo "cp /build/dist/sharp-layer.zip /dist/sharp-layer.$(uname -m).zip" > /entrypoint.sh && \

test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const sharp = require('sharp');
2+
3+
// 1x1 png
4+
const png = Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=', 'base64');
5+
6+
sharp(png).rotate(180).toBuffer()

0 commit comments

Comments
 (0)