avoid logs polluting the unit test output

pull/268/merge
El RIDO 7 years ago
parent 751731414e
commit 29419d03cd
No known key found for this signature in database
GPG Key ID: 0F5C940A6BD81F92

@ -414,7 +414,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
var orgArguments = arguments;
$(document).on(languageLoadedEvent, function () {
// log to show that the previous error could be mitigated
console.log('Fix missing translation of \'' + messageId + '\' with now loaded language ' + language);
console.warn('Fix missing translation of \'' + messageId + '\' with now loaded language ' + language);
// re-execute this function
me.translate.apply(this, orgArguments);
});
@ -1100,7 +1100,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
*/
me.showStatus = function(message, icon, dismissable, autoclose)
{
console.log('status shown: ', message);
console.info('status shown: ', message);
// @TODO: implement dismissable
// @TODO: implement autoclose
@ -1143,7 +1143,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
*/
me.showRemaining = function(message)
{
console.log('remaining message shown: ', message);
console.info('remaining message shown: ', message);
handleNotification(1, $remainingTime, message);
}
@ -1161,7 +1161,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
me.showLoading = function(message, percentage, icon)
{
if (typeof message !== 'undefined' && message !== null) {
console.log('status changed: ', message);
console.info('status changed: ', message);
}
// default message text
@ -2656,7 +2656,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
me.showViewButtons = function()
{
if (viewButtonsDisplayed) {
console.log('showViewButtons: view buttons are already displayed');
console.warn('showViewButtons: view buttons are already displayed');
return;
}
@ -2676,7 +2676,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
me.hideViewButtons = function()
{
if (!viewButtonsDisplayed) {
console.log('hideViewButtons: view buttons are already hidden');
console.warn('hideViewButtons: view buttons are already hidden');
return;
}
@ -2708,7 +2708,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
me.showCreateButtons = function()
{
if (createButtonsDisplayed) {
console.log('showCreateButtons: create buttons are already displayed');
console.warn('showCreateButtons: create buttons are already displayed');
return;
}
@ -2733,7 +2733,7 @@ jQuery.PrivateBin = function($, sjcl, Base64, RawDeflate) {
me.hideCreateButtons = function()
{
if (!createButtonsDisplayed) {
console.log('hideCreateButtons: create buttons are already hidden');
console.warn('hideCreateButtons: create buttons are already hidden');
return;
}

@ -25,8 +25,8 @@ global.RawDeflate.inflate = require('./rawinflate-0.3').RawDeflate.inflate;
require('./privatebin');
// redirect console messages to log file
console.warn = console.error = function (msg) {
logFile.write(msg + '\n');
console.info = console.warn = console.error = function () {
logFile.write(Array.prototype.slice.call(arguments).join('') + '\n');
}
describe('Helper', function () {

@ -69,7 +69,7 @@ if ($MARKDOWN):
<?php
endif;
?>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-QHNQsevnuA9oHZp2BV0Bi/hyf99g6+H/C2BhSnmlbyxU1SFXiLQvu43xdEl8qvZSoS2zf0R6rgH0sbSeVsrqsQ==" crossorigin="anonymous"></script>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-FyLKI8IhQHnJ24H05KGlzJGOht+xoMUj7Io5BL02qGUzdL6bXGPiQlmTOlbxAwDo0x+AP9m1pfGpI3UbC0T0sw==" crossorigin="anonymous"></script>
<!--[if lt IE 10]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
<![endif]-->

@ -47,7 +47,7 @@ if ($MARKDOWN):
<?php
endif;
?>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-QHNQsevnuA9oHZp2BV0Bi/hyf99g6+H/C2BhSnmlbyxU1SFXiLQvu43xdEl8qvZSoS2zf0R6rgH0sbSeVsrqsQ==" crossorigin="anonymous"></script>
<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-FyLKI8IhQHnJ24H05KGlzJGOht+xoMUj7Io5BL02qGUzdL6bXGPiQlmTOlbxAwDo0x+AP9m1pfGpI3UbC0T0sw==" crossorigin="anonymous"></script>
<!--[if lt IE 10]>
<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
<![endif]-->

Loading…
Cancel
Save