Skip to content

Commit

Permalink
Add test script for example; include it in CI job
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Aug 26, 2020
1 parent 3b19832 commit 5175da1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm test
- working-directory: examples
run: npm run build
- working-directory: examples
run: npm test
3 changes: 2 additions & 1 deletion examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"license": "ISC",
"private": true,
"scripts": {
"build": "../node_modules/.bin/rollup -c"
"build": "../node_modules/.bin/rollup -c",
"test": "sh test.sh"
}
}
6 changes: 6 additions & 0 deletions examples/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
set -e

node dist/factory.js | grep -q "factory { one: 'one', other: 'other' }" && echo "factory ok" || (echo "factory failed" && false)
node dist/ponyfill.js | grep -q "ponyfill { one: 'one', othe: 'other' }" && echo "ponyfill ok" || (echo "ponyfill failed" && false)
node dist/polyfill.js | grep -q "{ one: 'one', other: 'other' }" && echo "polyfill ok" || (echo "polyfill failed" && false)

0 comments on commit 5175da1

Please sign in to comment.