Skip to content

Commit

Permalink
feat(tests): Added browser tests with Mocha/Chai and support for Trav…
Browse files Browse the repository at this point in the history
…is CI
  • Loading branch information
rafa8626 committed Apr 17, 2018
1 parent 517dd18 commit b63fcda
Show file tree
Hide file tree
Showing 8 changed files with 304 additions and 2,457 deletions.
17 changes: 9 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
language: node_js
node_js:
- "0.10"
script: node_modules/karma/bin/karma start karma.conf.js --single-run
before_install:
- npm install
- export CHROME_BIN=/usr/bin/google-chrome
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
after_success:
- npm run coveralls
addons:
chrome: stable
branches:
only:
- master
git:
depth: 1
dist: trusty
sudo: required
cache:
directories:
- node_modules
script:
- npm run test
notifications:
email:
on_success: never
Expand Down
40 changes: 40 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
module.exports = config => {
config.set({
basePath: '',
browserNoActivityTimeout: 20000,
frameworks: ['mocha', 'chai'],
files: [
'./dist/om_player.*',
'./test/*.js',
],
customContextFile: 'test/context.html',
// reporters: ['mocha', 'coverage'],
reporters: ['mocha'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
browsers: ['ChromeHeadless'],
proxies: {
'/dist/': '/base/dist/',
'/test/': '/base/test/',
},
// preprocessors: {
// 'dist/om_player.js': 'coverage',
// },
autoWatch: false,
// coverageReporter: {
// dir: 'coverage',
// reporters: [
// {
// type: 'html',
// subdir: 'report-html'
// },
// {
// type: 'lcov',
// subdir: 'report-lcov'
// }
// ]
// },
concurrency: Infinity
});
};
73 changes: 0 additions & 73 deletions karma.coverage.js

This file was deleted.

32 changes: 0 additions & 32 deletions karma.unit.js

This file was deleted.

0 comments on commit b63fcda

Please sign in to comment.