Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds test coverage for alpine linux #68

Closed
wants to merge 2 commits into from
Closed
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
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ before_script:
- export CHROME_PATH="$(pwd)/chrome-linux/chrome"
- sh -e /etc/init.d/xvfb start
- sleep 3 # wait for xvfb to boot
- yarn build
- yarn run build
- yarn run build-docker
script:
- yarn test-formatting
- yarn test
- yarn run test-formatting
- yarn run test
- yarn run 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" ]