Skip to content

Commit

Permalink
use npm to test via node
Browse files Browse the repository at this point in the history
  • Loading branch information
ikatz-drizly committed Oct 31, 2018
1 parent 442f8fb commit 7ff9b12
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ services:

before_install:
- docker build -t eficode/wait-for .

script:
- npm install
- ./run_tests.sh
- docker run eficode/wait-for
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ WORKDIR /app
COPY . /app
RUN npm install

CMD ./node_modules/.bin/bats wait-for.bats
# On launch, run the test suite via npm
CMD npm test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "wait-for",
"version": "0.1.0",
"scripts": {
"test": "./node_modules/.bin/bats wait-for.bats"
"test": "./run_tests.sh"
},
"dependencies": {
"bats": "^0.4.2"
Expand Down
8 changes: 8 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

# Although it would be possible to just call this directly from the Dockerfile,
# centralizing tests in this file allows both the docker container and the
# CI machine to run the same set of tests for an additional datapoint --
# which gives a better chance of turning up POSIX noncompliance

./node_modules/.bin/bats wait-for.bats
2 changes: 1 addition & 1 deletion wait-for
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash

OLD_TIMEOUT=$TIMEOUT
OLD_QUIET=$QUIET
Expand Down

0 comments on commit 7ff9b12

Please sign in to comment.