fix tests

This commit is contained in:
Josh Junon 2018-09-10 23:07:20 -06:00 committed by Qix
parent 62822f1266
commit 57cde56e43
6 changed files with 32 additions and 9 deletions

13
.babelrc Normal file
View File

@ -0,0 +1,13 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"chrome": "58",
"ie": "8"
}
}
]
]
}

View File

@ -8,11 +8,10 @@ node_js:
- "10"
install:
- make install
- npm install
script:
- make lint
- make test
- make all
matrix:
include:

View File

@ -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:

View File

@ -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

View File

@ -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",

View File

@ -10,7 +10,7 @@ let debug;
if (typeof module !== 'undefined') {
chai = require('chai');
expect = chai.expect;
debug = require('../src');
debug = require('./src');
}
describe('debug', () => {