mirror of
https://github.com/debug-js/debug.git
synced 2026-01-18 16:12:38 +00:00
fix tests
This commit is contained in:
parent
62822f1266
commit
57cde56e43
13
.babelrc
Normal file
13
.babelrc
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"chrome": "58",
|
||||
"ie": "8"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
@ -8,11 +8,10 @@ node_js:
|
||||
- "10"
|
||||
|
||||
install:
|
||||
- make install
|
||||
- npm install
|
||||
|
||||
script:
|
||||
- make lint
|
||||
- make test
|
||||
- make all
|
||||
|
||||
matrix:
|
||||
include:
|
||||
|
||||
14
Makefile
14
Makefile
@ -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:
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -10,7 +10,7 @@ let debug;
|
||||
if (typeof module !== 'undefined') {
|
||||
chai = require('chai');
|
||||
expect = chai.expect;
|
||||
debug = require('../src');
|
||||
debug = require('./src');
|
||||
}
|
||||
|
||||
describe('debug', () => {
|
||||
Loading…
x
Reference in New Issue
Block a user