Skip to content

Commit

Permalink
Add nix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tesujimath committed Nov 25, 2024
1 parent 0fae304 commit f500c02
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
uses: cachix/install-nix-action@v30
- name: Run tests
run: |
nix develop '.#ci' --command ./tests.bats
nix develop '.#ci' --command bats tests.bats nix-tests.bats
15 changes: 15 additions & 0 deletions nix-tests.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bats
#
# simple tests for the Nix packaging

@test "simple" {
actual=$(echo 'export SOME_VARIABLE=some_value' | bash-env-json | jq -r '.env.SOME_VARIABLE')
expected='some_value'
test "$actual" == "$expected"
}

@test "path" {
actual=$(echo 'export PATH=/oops' | bash-env-json | jq -r '.env.PATH')
expected='/oops'
test "$actual" == "$expected"
}

0 comments on commit f500c02

Please sign in to comment.