Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

Commit

Permalink
Make test harness travis compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
surma committed Aug 9, 2017
1 parent 78ea2cd commit 2652a1e
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.pem
karma-*/
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sudo: required

services:
- docker

before_script: cd polyfill
script:
- docker build -t tasklets .
- docker run --rm -v `pwd`:/usr/src tasklets
13 changes: 9 additions & 4 deletions polyfill/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ USER root
RUN apt-get update -qqy \
&& apt-get -qqy install nodejs npm \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/* \
&& wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash \
&& . ~/.bashrc \
&& rm /bin/sh && ln -s /bin/bash /bin/sh \
&& chown seluser /usr/local

ENV NVM_DIR /usr/local/nvm
RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash \
&& source $NVM_DIR/nvm.sh \
&& nvm install v8

ENV CHROME_BIN /opt/google/chrome
ENV CHROME_BIN /opt/google/chrome/chrome
ENV INSIDE_DOCKER=1

WORKDIR /usr/src
ENTRYPOINT npm i && npm test
ENTRYPOINT source $NVM_DIR/nvm.sh && npm i && npm test
9 changes: 4 additions & 5 deletions polyfill/karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = function(config) {
const configuration = {
basePath: '',
frameworks: ['mocha'],
frameworks: ['mocha', 'chai'],
files: [
{
pattern: 'tasklet-polyfill.js',
Expand All @@ -15,7 +15,6 @@ const configuration = {
pattern: 'tests/fixtures/*',
included: false,
},
'node_modules/chai/chai.js',
'tests/tests.js',
],
preprocessors: {
Expand All @@ -30,9 +29,9 @@ const configuration = {
browsers: ['Chrome', 'Firefox', 'Safari'],
customLaunchers: {
DockerChrome: {
base: 'Chrome',
flags: ['--no-sandbox', '--headless'],
},
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
} ,
},
};

Expand Down
5 changes: 2 additions & 3 deletions polyfill/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@
"chai": "^4.1.1",
"karma": "^1.7.0",
"karma-mocha": "^1.3.0",
"mocha": "^3.5.0"
},
"dependencies": {
"mocha": "^3.5.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-firefox-launcher": "^1.0.1",
"karma-safari-launcher": "^1.0.0"
Expand Down

0 comments on commit 2652a1e

Please sign in to comment.