bv-ui-core
Advanced tools
Comparing version 0.8.0 to 0.9.0
# Changelog | ||
## 0.9.0 | ||
* Add a static asset loader implementation. | ||
## 0.8.1 | ||
* Add region module with EU support | ||
* Use public travis build status logo. | ||
## 0.8.0 | ||
* Include mocha in package.json devDependencies. | ||
* Fix calls to arguments.slice in Logger.group and groupEnd. | ||
* Add tests for Logger.group and Logger.groupEnd. | ||
* Add logger module to readme. | ||
* Default LogLevel to OFF. Add force param to setLogLevel. | ||
## 0.7.0 | ||
* Update documentation for minor issues. | ||
* Add logger and bookmarklet. | ||
## 0.6.0 | ||
* Add pixelsDisplayed module. | ||
* Add pixelsDisplayed module. | ||
## 0.5.0 | ||
* Add namespacer and application modules. | ||
* Add namespacer and application modules. | ||
## 0.4.0 | ||
* Use Mocha for tests. | ||
* Add cookie, evented, ie, and loader modules. | ||
* Tidy up documentation. | ||
* Use Mocha for tests. | ||
* Add cookie, evented, ie, and loader modules. | ||
* Tidy up documentation. | ||
## 0.3.0 | ||
* Add body module. | ||
* Add body module. | ||
## 0.2.0 | ||
* Add checkHighContrast module. | ||
* Update Karma to version 0.13.9. | ||
* Add checkHighContrast module. | ||
* Update Karma to version 0.13.9. | ||
## 0.1.0 | ||
* Initial release. | ||
* Initial release. |
@@ -62,2 +62,3 @@ /*jshint expr:true */ | ||
* Only sets the log level if there is no cookie or if passed a force param. | ||
* | ||
* @param {[type]} level logLevel | ||
@@ -154,5 +155,6 @@ * @param {[type]} force arg to force setting level to the level arg | ||
// If we want to log something that's computationally expensive, we can pass a function | ||
// to a Logger method as its sole argument. The function should return the arguments | ||
// to be logged; the function will only ever be executed in the development environment. | ||
// If we want to log something that's computationally expensive, we can pass a | ||
// function to a Logger method as its sole argument. The function should | ||
// return the arguments to be logged; the function will only ever be executed | ||
// in the development environment. | ||
args = [].slice.call(args); | ||
@@ -165,3 +167,3 @@ | ||
if (ie) { | ||
console.log(args); | ||
global.console.log(args); | ||
return; | ||
@@ -171,9 +173,9 @@ } | ||
try { | ||
(console[level] || console.log).apply(console, args); | ||
(global.console[level] || global.console.log).apply(global.console, args); | ||
} | ||
catch (e) { | ||
// If we are unable to call, log then we cannot do anything but silently fail. | ||
// In reality, you will either see your logs or you wont. And if you don't see | ||
// the logs, there are only two cases: 1 - your logLevel is incorrect or 2 - | ||
// logging is failing. | ||
// If we are unable to call, log then we cannot do anything but silently | ||
// fail. In reality, you will either see your logs or you wont. And if you | ||
// don't see the logs, there are only two cases: 1 - your logLevel is | ||
// incorrect or 2 - logging is failing. | ||
} | ||
@@ -180,0 +182,0 @@ } |
{ | ||
"name": "bv-ui-core", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"license": "Apache 2.0", | ||
@@ -17,20 +17,20 @@ "description": "Bazaarvoice UI-related JavaScript", | ||
"devDependencies": { | ||
"eslint": "1.3.1", | ||
"ghooks": "0.3.2", | ||
"istanbul-instrumenter-loader": "0.1.3", | ||
"karma": "0.13.9", | ||
"eslint": "2.2.0", | ||
"ghooks": "1.0.3", | ||
"istanbul-instrumenter-loader": "0.2.0", | ||
"karma": "0.13.21", | ||
"karma-chai": "0.1.0", | ||
"karma-chrome-launcher": "0.2.0", | ||
"karma-coverage": "0.5.1", | ||
"karma-firefox-launcher": "0.1.6", | ||
"karma-chrome-launcher": "0.2.2", | ||
"karma-coverage": "0.5.3", | ||
"karma-firefox-launcher": "0.1.7", | ||
"karma-htmlfile-reporter": "0.2.2", | ||
"karma-mocha": "0.2.0", | ||
"karma-phantomjs-launcher": "0.2.1", | ||
"karma-mocha": "0.2.2", | ||
"karma-phantomjs-launcher": "1.0.0", | ||
"karma-sinon": "1.0.4", | ||
"karma-sinon-chai": "1.1.0", | ||
"karma-sinon-chai": "1.2.0", | ||
"karma-webpack": "1.7.0", | ||
"mocha": "2.3.4", | ||
"node-libs-browser": "0.5.2", | ||
"phantomjs": "1.9.18", | ||
"webpack": "1.12.0" | ||
"mocha": "2.4.5", | ||
"node-libs-browser": "1.0.0", | ||
"phantomjs": "2.1.3", | ||
"webpack": "1.12.13" | ||
}, | ||
@@ -37,0 +37,0 @@ "config": { |
@@ -1,2 +0,2 @@ | ||
![](https://magnum.travis-ci.com/bazaarvoice/bv-ui-core.svg?token=hwKyg8j4RFg7BgmSksac&branch=master) | ||
![](https://travis-ci.org/bazaarvoice/bv-ui-core.svg) | ||
@@ -54,4 +54,5 @@ # bv-ui-core | ||
- [pixelsDisplayed](./lib/pixelsDisplayed) | ||
- [staticAssetLoader](./lib/staticAssetLoader) | ||
[1]: ./CONTRIBUTING.md | ||
[2]: https://nodejs.org/download/ |
@@ -10,31 +10,23 @@ /** | ||
describe('lib/logger', function () { | ||
var debugStub, | ||
logStub, | ||
infoStub, | ||
warnStub, | ||
errorStub, | ||
groupStub, | ||
groupEndStub; | ||
var sandbox; | ||
var debugStub; | ||
var logStub; | ||
var infoStub; | ||
var groupStub; | ||
var groupEndStub; | ||
before(function () { | ||
debugStub = sinon.stub(console, 'debug'); | ||
logStub = sinon.stub(console, 'log'); | ||
infoStub = sinon.stub(console, 'info'); | ||
warnStub = sinon.stub(console, 'warn'); | ||
errorStub = sinon.stub(console, 'error'); | ||
groupStub = sinon.stub(console, 'group'); | ||
groupEndStub = sinon.stub(console, 'groupEnd'); | ||
beforeEach(function () { | ||
sandbox = sinon.sandbox.create(); | ||
debugStub = sandbox.stub(global.console, 'debug'); | ||
logStub = sandbox.stub(global.console, 'log'); | ||
infoStub = sandbox.stub(global.console, 'info'); | ||
groupStub = sandbox.stub(global.console, 'group'); | ||
groupEndStub = sandbox.stub(global.console, 'groupEnd'); | ||
}); | ||
afterEach(function () { | ||
debugStub.reset(); | ||
logStub.reset(); | ||
infoStub.reset(); | ||
warnStub.reset(); | ||
errorStub.reset(); | ||
groupStub.reset(); | ||
groupEndStub.reset(); | ||
// reset the log level to the default | ||
Logger.setLogLevel(Logger.INFO); | ||
sandbox.restore(); | ||
}); | ||
@@ -44,6 +36,6 @@ | ||
Logger.info('Hello'); | ||
expect(infoStub).not.to.have.been.called; | ||
sinon.assert.notCalled(infoStub); | ||
Logger.setLogLevel(Logger.INFO, true); | ||
Logger.info('World'); | ||
expect(infoStub).to.have.been.calledWith('World'); | ||
sinon.assert.calledWith(infoStub, 'World'); | ||
}); | ||
@@ -54,3 +46,3 @@ | ||
Logger.debug('foo'); | ||
expect(debugStub).to.not.have.been.called; | ||
sinon.assert.notCalled(debugStub); | ||
}); | ||
@@ -63,5 +55,5 @@ | ||
Logger.info('foo'); | ||
expect(infoStub).to.not.have.been.called; | ||
global.console = tempConsole; | ||
global.console = tempConsole; | ||
sinon.assert.notCalled(infoStub); | ||
}); | ||
@@ -68,0 +60,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
141877
74
3238
58