-
Notifications
You must be signed in to change notification settings - Fork 944
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
766 additions
and
613 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
const http = require('http'); | ||
|
||
var debug = require('../../')('http') | ||
, http = require('http') | ||
, name = 'My App'; | ||
const debug = require('../..')('http'); | ||
|
||
// fake app | ||
const name = 'My App'; | ||
|
||
// Fake app | ||
|
||
debug('booting %o', name); | ||
|
||
http.createServer(function(req, res){ | ||
debug(req.method + ' ' + req.url); | ||
res.end('hello\n'); | ||
}).listen(3000, function(){ | ||
debug('listening'); | ||
http.createServer((req, res) => { | ||
debug(req.method + ' ' + req.url); | ||
res.end('hello\n'); | ||
}).listen(3000, () => { | ||
debug('listening'); | ||
}); | ||
|
||
// fake worker of some kind | ||
|
||
// Fake worker of some kind | ||
// eslint-disable-next-line import/no-unassigned-import | ||
require('./worker'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
var debug = require('../../') | ||
const debug = require('../..'); | ||
|
||
debug.enable('*') | ||
debug.enable('*'); | ||
|
||
for (var i=0; i < debug.colors.length; i++) { | ||
const d = debug('example:' + i); | ||
d('The color is %o', d.color); | ||
for (let i = 0; i < debug.colors.length; i++) { | ||
const d = debug('example:' + i); | ||
d('The color is %o', d.color); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
|
||
var debug = { | ||
foo: require('../../')('test:foo'), | ||
bar: require('../../')('test:bar'), | ||
baz: require('../../')('test:baz') | ||
const debug = { | ||
foo: require('../..')('test:foo'), | ||
bar: require('../..')('test:bar'), | ||
baz: require('../..')('test:baz') | ||
}; | ||
|
||
debug.foo('foo') | ||
debug.bar('bar') | ||
debug.baz('baz') | ||
debug.foo('foo'); | ||
debug.bar('bar'); | ||
debug.baz('baz'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,60 @@ | ||
// Karma configuration | ||
// Generated on Fri Dec 16 2016 13:09:51 GMT+0000 (UTC) | ||
|
||
module.exports = function(config) { | ||
config.set({ | ||
|
||
// base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: '', | ||
|
||
|
||
// frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['mocha', 'chai', 'sinon'], | ||
|
||
|
||
// list of files / patterns to load in the browser | ||
files: [ | ||
'dist/debug.js', | ||
'test/*spec.js' | ||
], | ||
|
||
|
||
// list of files to exclude | ||
exclude: [ | ||
'src/node.js' | ||
], | ||
|
||
|
||
// preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
}, | ||
|
||
// test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['progress'], | ||
|
||
|
||
// web server port | ||
port: 9876, | ||
|
||
|
||
// enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
|
||
// level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
|
||
// enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: true, | ||
|
||
|
||
// start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['PhantomJS'], | ||
|
||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: false, | ||
|
||
// Concurrency level | ||
// how many browser should be started simultaneous | ||
concurrency: Infinity | ||
}) | ||
} | ||
module.exports = function (config) { | ||
config.set({ | ||
|
||
// Base path that will be used to resolve all patterns (eg. files, exclude) | ||
basePath: '', | ||
|
||
// Frameworks to use | ||
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter | ||
frameworks: ['mocha', 'chai', 'sinon'], | ||
|
||
// List of files / patterns to load in the browser | ||
files: [ | ||
'dist/debug.js', | ||
'test/*spec.js' | ||
], | ||
|
||
// List of files to exclude | ||
exclude: [ | ||
'src/node.js' | ||
], | ||
|
||
// Preprocess matching files before serving them to the browser | ||
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor | ||
preprocessors: { | ||
}, | ||
|
||
// Test results reporter to use | ||
// possible values: 'dots', 'progress' | ||
// available reporters: https://npmjs.org/browse/keyword/karma-reporter | ||
reporters: ['progress'], | ||
|
||
// Web server port | ||
port: 9876, | ||
|
||
// Enable / disable colors in the output (reporters and logs) | ||
colors: true, | ||
|
||
// Level of logging | ||
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
logLevel: config.LOG_INFO, | ||
|
||
// Enable / disable watching file and executing tests whenever any file changes | ||
autoWatch: true, | ||
|
||
// Start these browsers | ||
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher | ||
browsers: ['PhantomJS'], | ||
|
||
// Continuous Integration mode | ||
// if true, Karma captures browsers, runs the tests and exits | ||
singleRun: false, | ||
|
||
// Concurrency level | ||
// how many browser should be started simultaneous | ||
concurrency: Infinity | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.