From f24f2066e30e61f5b58d8d31ae5167394b8d9a1d Mon Sep 17 00:00:00 2001 From: Tim Nederhoff Date: Sun, 9 Dec 2018 16:42:03 +0100 Subject: [PATCH] refactor: removed config file feature --- src/index.js | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/index.js b/src/index.js index a8177d0..2f71333 100644 --- a/src/index.js +++ b/src/index.js @@ -2,26 +2,6 @@ /* eslint import/no-dynamic-require: 0 */ const fs = require('fs'); -const path = require('path'); - -const dirname = path.dirname(__dirname); - -// default values for config -const config = { - fileName: 'report.html', - outputPath: '../../', -}; - -if (process.env.NODE_ENV === 'test') { - config.outputPath = './'; -} - -// add values for config from config file tcr-html.config.js -if (fs.existsSync(`${dirname}/../../tcr-html.config.js`)) { - const newConfig = require(`${dirname}/../../tcr-html.config.js`); - config.fileName = newConfig.fileName ? newConfig.fileName : config.fileName; - config.outputPath = newConfig.outputPath ? newConfig.outputPath : config.outputPath; -} module.exports = () => ({ noColors: true, @@ -263,11 +243,5 @@ module.exports = () => ({ `; this.write(html); - - try { - fs.writeFileSync(`${config.outputPath}/${config.fileName}`, html); - } catch (e) { - console.log('Cannot write file ', e); - } }, });