Skip to content

Commit

Permalink
Adds test coverage for alpine linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Beaupre authored and samccone committed Apr 1, 2018
1 parent aa66aef commit bbea403
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ before_script:
script:
- yarn test-formatting
- yarn test
- yarn docker-test
after_success:
- yarn run coverage
# - (send to coveralls)
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"scripts": {
"build": "tsc",
"dev": "tsc -w",
"build-docker": "docker build -t chrome-launcher:test -f test/Dockerfile .",
"docker-test": "docker run --privileged -t chrome-launcher:test",
"test": "mocha --require ts-node/register --reporter=dot test/**/*-test.ts --timeout=10000",
"coverage": "nyc yarn test && nyc report --reporter=text-lcov > lcov.info",
"test-formatting": "test/check-formatting.sh",
Expand Down
25 changes: 25 additions & 0 deletions test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:alpine

WORKDIR /app

#install chromium/yarn
RUN apk --update --no-cache add chromium xvfb curl bash binutils tar \
&& curl -o- -L https://yarnpkg.com/install.sh | bash \
&& apk del curl tar binutils

COPY package.json .
COPY yarn.lock .

ENV DISPLAY :99.0
ENV CHROME_PATH /usr/lib/chrome

#install
RUN yarn --frozen-lockfile

#copy rest of files in
COPY . .

#build everything
RUN yarn build

ENTRYPOINT [ "/bin/bash", "-c", "yarn test-formatting && yarn test" ]

0 comments on commit bbea403

Please sign in to comment.