From 70007285bfcca11d8114d254c84fe55bc16705a6 Mon Sep 17 00:00:00 2001 From: El RIDO Date: Tue, 25 Dec 2018 16:42:18 +0100 Subject: [PATCH] remove console suppression, fixing I18n mock --- js/common.js | 6 ------ js/test/I18n.js | 9 ++++++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/js/common.js b/js/common.js index 94bef5b..4c7c7fa 100644 --- a/js/common.js +++ b/js/common.js @@ -50,15 +50,9 @@ var a2zString = ['a','b','c','d','e','f','g','h','i','j','k','l','m', '`': '`', '=': '=' }, - logFile = fs.createWriteStream('test.log'), mimeFile = fs.createReadStream('/etc/mime.types'), mimeLine = ''; -// redirect console messages to log file -console.info = console.warn = console.error = function () { - logFile.write(Array.prototype.slice.call(arguments).join('') + '\n'); -}; - // populate mime types from environment mimeFile.on('data', function(data) { mimeLine += data; diff --git a/js/test/I18n.js b/js/test/I18n.js index 10d333a..06c65b7 100644 --- a/js/test/I18n.js +++ b/js/test/I18n.js @@ -87,14 +87,17 @@ describe('I18n', function () { 'downloads and handles any supported language', common.jscSupportedLanguages(), function(language) { - var clean = jsdom('', {url: 'https://privatebin.net/', cookie: ['lang=' + language]}); - + // cleanup + var clean = jsdom('', {cookie: ['lang=en']}); $.PrivateBin.I18n.reset('en'); $.PrivateBin.I18n.loadTranslations(); + clean(); + + // mock + clean = jsdom('', {cookie: ['lang=' + language]}); $.PrivateBin.I18n.reset(language, require('../../i18n/' + language + '.json')); var result = $.PrivateBin.I18n.translate('en'), alias = $.PrivateBin.I18n._('en'); - clean(); return language === result && language === alias; }