Skip to content

Commit

Permalink
Merge pull request webrtcHacks#25 from webrtc/testling
Browse files Browse the repository at this point in the history
Adding Javascript tests using testling.
  • Loading branch information
alvestrand committed May 26, 2015
2 parents 8da8b30 + 79d5b35 commit 6ca68cf
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 4 deletions.
33 changes: 30 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@
sudo: false
language: node_js
node_js:
- 0.10
- 0.10

env:
matrix:
- BROWSER=chrome BVER=stable
- BROWSER=chrome BVER=beta
- BROWSER=chrome BVER=unstable
- BROWSER=firefox BVER=stable
- BROWSER=firefox BVER=beta
- BROWSER=firefox BVER=unstable

matrix:
fast_finish: true

allow_failures:
- env: BROWSER=chrome BVER=unstable
- env: BROWSER=firefox BVER=unstable

install:
- npm install -g jshint jscs
- npm install

before_script:
- ./node_modules/travis-multirunner/setup.sh
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start

script:
- jshint *.js
- jscs --preset google *.js
- jshint *.js
- jscs --preset google *.js
- npm test

after_failure:
- for file in *.log; do echo $file; echo "======================"; cat $file; done || true
22 changes: 21 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
{
"name": "webrtc-adapter",
"version": "0.1.0",
"description": "Hide browser differences in WebRTC APIs",
"license": "BSD-3-Clause",
"repository": {
"type": "git",
"url": "https://github.com/w3brtc/adapter.git"
},
"scripts": {
"test": "testling -x start-$BROWSER"
},
"testling": {
"files": "test/test.js",
"browsers": [
"chrome/34..latest",
"firefox/25..latest"
]
},
"devDependencies": {
"browserify": "^10.2.1",
"grunt": "^0.4.5",
"grunt-contrib-jshint": "^0.11.2",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-uglify": "~0.5.0"
"grunt-contrib-uglify": "~0.5.0",
"tape": "^4.0.0",
"testling": "^1.7.1",
"travis-multirunner": "^2.1.0"
}
}
11 changes: 11 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// This is a basic test file for use with testling.
// The test script language comes from tape.
var test = require('tape');

m = require('../adapter.js');

test('Browser identified', function(t) {
t.plan(2);
t.ok(m.webrtcDetectedBrowser, 'Browser detected');
t.ok(m.webrtcDetectedVersion, 'Browser version detected');
});

0 comments on commit 6ca68cf

Please sign in to comment.