Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,12 @@ ENV PATH=/data/node_modules/.bin:$PATH

# Temporary build stage where we can run the test suite.
FROM base AS test
COPY --from=ghcr.io/goss-org/goss:latest /usr/bin/goss /usr/bin/goss
ADD goss.yml /tmp/goss.yml
RUN goss --gossfile=/tmp/goss.yml validate

USER root
RUN apk add bats

ADD tests.bats /tmp/tests.bats
RUN bats /tmp/tests.bats

FROM base AS run
CMD ["bash"]
18 changes: 0 additions & 18 deletions goss.yml

This file was deleted.

25 changes: 25 additions & 0 deletions tests.bats
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bats

setup() {
# load helper libraries when using the official Docker image
bats_load_library bats-support
bats_load_library bats-assert
}

@test "npm --help exits 1 and mentions DISCLAIMER" {
run npm --help
[ "$status" -eq 1 ]
assert_output --partial "DISCLAIMER"
}

@test "yarn --help exits 0 and mentions DISCLAIMER" {
run yarn --help
[ "$status" -eq 0 ]
assert_output --partial "DISCLAIMER"
}

@test "pnpm --help exits 0 and mentions 'compiled to binary'" {
run pnpm --help
[ "$status" -eq 0 ]
assert_output --partial "compiled to binary"
}