Skip to content

Commit

Permalink
Add output input test (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
nizarmah authored Mar 19, 2024
1 parent 17c2261 commit 43cd120
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Test overwrite
uses: ./
with:
Expand All @@ -71,3 +71,26 @@ jobs:
git diff --exit-code --no-index \
tests/overwrite/main.expected.js \
tests/overwrite/main.js
output:
runs-on: ubuntu-latest

steps:
- name: Checkout the repository
uses: actions/checkout@v4

- name: Test output
uses: ./
with:
directory: "tests/output"
output: "tests/output/prod/js"

- name: Assert output directory is created
run: |
test -d tests/output/prod/js
- name: Assert output result matches expected
run: |
git diff --exit-code --no-index \
tests/output/main.expected.js \
tests/output/prod/js/main.min.js
1 change: 1 addition & 0 deletions tests/output/main.expected.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions tests/output/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function print_hello() {
console.log('hello world from output');
}

window.addEventListener('load', function () {
print_hello();
});

0 comments on commit 43cd120

Please sign in to comment.