Skip to content

Commit

Permalink
add browser test
Browse files Browse the repository at this point in the history
  • Loading branch information
ronhippler committed Jul 27, 2018
1 parent 1b45e9a commit 3a97b3c
Show file tree
Hide file tree
Showing 4 changed files with 2,462 additions and 56 deletions.
25 changes: 18 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
language: node_js

node_js:
- "lts/*"
- "node"
cache:
directories:
- node_modules

notifications:
email: false
matrix:
include:
- node_js: "lts/*"
env: YARN_TASK=coverage
- node_js: "node"
env: YARN_TASK=coverage
- node_js: "node"
env: YARN_TASK=test_browser
addons:
chrome: stable

script: yarn run $YARN_TASK

script: npm run coverage
after_success: yarn run coveralls

after_success: 'npm run coveralls'
notifications:
email: false
29 changes: 29 additions & 0 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = function (config) {
config.set({
frameworks: ["mocha", "karma-typescript"],
files: [
{ pattern: "src/**/*.ts" }
],
preprocessors: {
"**/*.ts": ["karma-typescript"]
},
reporters: ["mocha", "karma-typescript"],
browsers: ["Chrome"],
karmaTypescriptConfig: {
compilerOptions: {
target: "ES5",
lib: ["es2015", "dom"]
},
tsconfig: "tsconfig.json",
reports: {
"text": "",
"lcovonly": {
"directory": "coverage",
"filename": "lcov.info",
"subdirectory": "/"
},
}
},
singleRun: true
});
};
15 changes: 11 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"name": "dvbjs",
"version": "5.0.0",
"description": "query Dresden's public transport system for current bus- and tramstop data",
"description": "query Dresden's public transport system for current bus- and tram stop data",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"build": "yarn lint && tsc -p .",
"clean": "rimraf coverage lib",
"test": "mocha",
"test": "mocha --opts mocha.opts",
"test_browser": "karma start",
"coverage": "nyc mocha --opts mocha.opts",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"coveralls": "cat ./coverage/lcov.info | coveralls",
"lint": "tslint src/**/*.ts --fix"
},
"repository": {
Expand Down Expand Up @@ -71,6 +72,11 @@
"chai-as-promised": "^7.1.1",
"coveralls": "^3.0.2",
"fs-extra-promise": "^1.0.1",
"karma": "^2.0.5",
"karma-chrome-launcher": "^2.2.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.5",
"karma-typescript": "^3.0.13",
"mocha": "^5.2.0",
"mockery": "^2.1.0",
"nyc": "^12.0.2",
Expand All @@ -85,14 +91,15 @@
".ts"
],
"exclude": [
"**/*.js",
"**/*.spec.ts",
"**/*.d.ts",
"coverage",
"dist"
],
"reporter": [
"text",
"html"
"lcov"
],
"all": true
}
Expand Down
Loading

0 comments on commit 3a97b3c

Please sign in to comment.