@storybook/client-logger
Advanced tools
Comparing version 5.0.0-debug.0 to 5.0.0-debug.1
"use strict"; | ||
require("core-js/modules/es6.object.define-property"); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.logger = void 0; | ||
var _global = global, | ||
console = _global.console; | ||
var logger = { | ||
log: function log(message) { | ||
return console.log(message); | ||
}, | ||
info: function info(message) { | ||
return console.info(message); | ||
}, | ||
warn: function warn(message) { | ||
return console.warn(message); | ||
}, | ||
error: function error(message) { | ||
return console.error(message); | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var console = global.console; | ||
exports.logger = { | ||
info: function (message) { return console.log(message); }, | ||
warn: function (message) { return console.warn(message); }, | ||
error: function (message) { return console.error(message); }, | ||
}; | ||
exports.logger = logger; |
{ | ||
"name": "@storybook/client-logger", | ||
"version": "5.0.0-debug.0", | ||
"version": "5.0.0-debug.1", | ||
"description": "", | ||
@@ -18,3 +18,3 @@ "keywords": [ | ||
"main": "dist/index.js", | ||
"jsnext:main": "src/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
@@ -26,3 +26,3 @@ "prepare": "node ../../scripts/prepare.js" | ||
}, | ||
"gitHead": "7cacf4b23fc7682e0891e8fd4a3983e8879f84c5" | ||
"gitHead": "207598ad16237207116f771aa176321f998ccd6c" | ||
} |
@@ -1,8 +0,8 @@ | ||
const { console } = global; | ||
export const logger = { | ||
log: message => console.log(message), | ||
info: message => console.info(message), | ||
warn: message => console.warn(message), | ||
error: message => console.error(message), | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var console = global.console; | ||
exports.logger = { | ||
info: function (message) { return console.log(message); }, | ||
warn: function (message) { return console.warn(message); }, | ||
error: function (message) { return console.error(message); }, | ||
}; |
@@ -1,33 +0,45 @@ | ||
import { logger } from '.'; | ||
describe('client-logger', () => { | ||
const initialConsole = { ...global.console }; | ||
beforeEach(() => { | ||
global.console.log = jest.fn(); | ||
global.console.warn = jest.fn(); | ||
global.console.error = jest.fn(); | ||
}); | ||
afterAll(() => { | ||
global.console = initialConsole; | ||
}); | ||
it('should have an info method that displays the message', () => { | ||
const message = 'information'; | ||
logger.info(message); | ||
expect(global.console.info).toHaveBeenCalledWith(message); | ||
}); | ||
it('should have an log method that displays the message', () => { | ||
const message = 'information'; | ||
logger.log(message); | ||
expect(global.console.log).toHaveBeenCalledWith(message); | ||
}); | ||
it('should have a warning method that displays the message in yellow, with a trace', () => { | ||
const message = 'warning message'; | ||
logger.warn(message); | ||
expect(global.console.warn).toHaveBeenCalledWith(message); | ||
}); | ||
it('should have an error method that displays the message in red, with a trace', () => { | ||
const message = 'error message'; | ||
logger.error(message); | ||
expect(global.console.error).toHaveBeenCalledWith(message); | ||
}); | ||
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var _1 = require("."); | ||
describe('client-logger', function () { | ||
var initialConsole = __assign({}, global.console); | ||
beforeEach(function () { | ||
global.console.log = jest.fn(); | ||
global.console.warn = jest.fn(); | ||
global.console.error = jest.fn(); | ||
}); | ||
afterAll(function () { | ||
global.console = initialConsole; | ||
}); | ||
it('should have an info method that displays the message', function () { | ||
var message = 'information'; | ||
_1.logger.info(message); | ||
expect(global.console.info).toHaveBeenCalledWith(message); | ||
}); | ||
it('should have an log method that displays the message', function () { | ||
var message = 'information'; | ||
_1.logger.log(message); | ||
expect(global.console.log).toHaveBeenCalledWith(message); | ||
}); | ||
it('should have a warning method that displays the message in yellow, with a trace', function () { | ||
var message = 'warning message'; | ||
_1.logger.warn(message); | ||
expect(global.console.warn).toHaveBeenCalledWith(message); | ||
}); | ||
it('should have an error method that displays the message in red, with a trace', function () { | ||
var message = 'error message'; | ||
_1.logger.error(message); | ||
expect(global.console.error).toHaveBeenCalledWith(message); | ||
}); | ||
}); |
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
6316
12
118