Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Qix- committed Sep 11, 2018
1 parent 62822f1 commit 57cde56
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 9 deletions.
13 changes: 13 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": "58",
"ie": "8"
}
}
]
]
}
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ node_js:
- "10"

install:
- make install
- npm install

script:
- make lint
- make test
- make all

matrix:
include:
Expand Down
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,25 @@ BROWSERIFY ?= $(NODE) $(BIN)/browserify

all: lint test

browser: dist/debug.js
browser: dist/debug.js dist/test.js

dist/debug.js: src/*.js
@mkdir -p dist
@$(BROWSERIFY) --standalone debug . > dist/debug.js
@$(BROWSERIFY) --standalone debug . > $@.es6.js
@babel $@.es6.js > $@
@rm $@.es6.js

dist/test.js: test.js
@mkdir -p dist
@cp $< $@.es6.js
@babel $@.es6.js > $@
@rm $@.es6.js

lint:
@xo

test-node:
@istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
@istanbul cover node_modules/mocha/bin/_mocha -- test.js
@cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js

test-browser:
Expand Down
4 changes: 2 additions & 2 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ module.exports = function (config) {

// Frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['mocha', 'chai', 'sinon'],
frameworks: ['mocha', 'chai'],

// List of files / patterns to load in the browser
files: [
'dist/debug.js',
'test/*spec.js'
'dist/test.js'
],

// List of files to exclude
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"ms": "^2.1.1"
},
"devDependencies": {
"@babel/cli": "^7.0.0",
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"browserify": "14.4.0",
"chai": "^3.5.0",
"concurrently": "^3.1.0",
Expand Down
2 changes: 1 addition & 1 deletion test/debug-spec.js → test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let debug;
if (typeof module !== 'undefined') {
chai = require('chai');
expect = chai.expect;
debug = require('../src');
debug = require('./src');
}

describe('debug', () => {
Expand Down

0 comments on commit 57cde56

Please sign in to comment.