Skip to content

Commit 57cde56

Browse files
committedSep 11, 2018
fix tests
1 parent 62822f1 commit 57cde56

File tree

6 files changed

+32
-9
lines changed

6 files changed

+32
-9
lines changed
 

‎.babelrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env",
5+
{
6+
"targets": {
7+
"chrome": "58",
8+
"ie": "8"
9+
}
10+
}
11+
]
12+
]
13+
}

‎.travis.yml

+2-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ node_js:
88
- "10"
99

1010
install:
11-
- make install
11+
- npm install
1212

1313
script:
14-
- make lint
15-
- make test
14+
- make all
1615

1716
matrix:
1817
include:

‎Makefile

+11-3
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,25 @@ BROWSERIFY ?= $(NODE) $(BIN)/browserify
1717

1818
all: lint test
1919

20-
browser: dist/debug.js
20+
browser: dist/debug.js dist/test.js
2121

2222
dist/debug.js: src/*.js
2323
@mkdir -p dist
24-
@$(BROWSERIFY) --standalone debug . > dist/debug.js
24+
@$(BROWSERIFY) --standalone debug . > $@.es6.js
25+
@babel $@.es6.js > $@
26+
@rm $@.es6.js
27+
28+
dist/test.js: test.js
29+
@mkdir -p dist
30+
@cp $< $@.es6.js
31+
@babel $@.es6.js > $@
32+
@rm $@.es6.js
2533

2634
lint:
2735
@xo
2836

2937
test-node:
30-
@istanbul cover node_modules/mocha/bin/_mocha -- test/**.js
38+
@istanbul cover node_modules/mocha/bin/_mocha -- test.js
3139
@cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
3240

3341
test-browser:

‎karma.conf.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ module.exports = function (config) {
99

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

1414
// List of files / patterns to load in the browser
1515
files: [
1616
'dist/debug.js',
17-
'test/*spec.js'
17+
'dist/test.js'
1818
],
1919

2020
// List of files to exclude

‎package.json

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
"ms": "^2.1.1"
2222
},
2323
"devDependencies": {
24+
"@babel/cli": "^7.0.0",
25+
"@babel/core": "^7.0.0",
26+
"@babel/preset-env": "^7.0.0",
2427
"browserify": "14.4.0",
2528
"chai": "^3.5.0",
2629
"concurrently": "^3.1.0",

‎test/debug-spec.js ‎test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let debug;
1010
if (typeof module !== 'undefined') {
1111
chai = require('chai');
1212
expect = chai.expect;
13-
debug = require('../src');
13+
debug = require('./src');
1414
}
1515

1616
describe('debug', () => {

0 commit comments

Comments
 (0)
Please sign in to comment.