diff --git a/lib/SlackMessage.js b/lib/SlackMessage.js index 6b1f1b4..31be631 100644 --- a/lib/SlackMessage.js +++ b/lib/SlackMessage.js @@ -14,7 +14,7 @@ var _config = require('./config'); var _config2 = _interopRequireDefault(_config); -var _constLoggingLevels = require("./const/loggingLevels"); +var _constLoggingLevels = require("./const/LoggingLevels"); var _constLoggingLevels2 = _interopRequireDefault(_constLoggingLevels); diff --git a/lib/config.js b/lib/config.js index 4c2cd11..b73f351 100644 --- a/lib/config.js +++ b/lib/config.js @@ -10,7 +10,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'd var _utilsFileHelpers = require('./utils/fileHelpers'); -var _constLoggingLevels = require('./const/loggingLevels'); +var _constLoggingLevels = require('./const/LoggingLevels'); var _constLoggingLevels2 = _interopRequireDefault(_constLoggingLevels); diff --git a/lib/const/LoggingLevels.js b/lib/const/LoggingLevels.js index e3614df..275b2ad 100644 --- a/lib/const/LoggingLevels.js +++ b/lib/const/LoggingLevels.js @@ -3,10 +3,10 @@ Object.defineProperty(exports, '__esModule', { value: true }); -var loggingLevels = { +var LoggingLevels = { TEST: 'TEST', SUMMARY: 'SUMMARY' }; -exports['default'] = loggingLevels; +exports['default'] = LoggingLevels; module.exports = exports['default']; \ No newline at end of file diff --git a/src/SlackMessage.js b/src/SlackMessage.js index 011d29b..b7f75e7 100644 --- a/src/SlackMessage.js +++ b/src/SlackMessage.js @@ -1,5 +1,5 @@ import config from './config'; -import loggingLevels from "./const/loggingLevels"; +import loggingLevels from "./const/LoggingLevels"; export default class SlackMessage { constructor() { diff --git a/src/config.js b/src/config.js index de68bfd..5f801b6 100644 --- a/src/config.js +++ b/src/config.js @@ -5,13 +5,13 @@ import { isFileExists, readFile } from './utils/fileHelpers'; -import loggingLevels from './const/loggingLevels'; +import LoggingLevels from './const/LoggingLevels'; const defaultConfig = { webhookUrl: process.env.TESTCAFE_SLACK_WEBHOOK || 'https://hooks.slack.com/services/*****', channel: process.env.TESTCAFE_SLACK_CHANNEL || '#testcafe', username: process.env.TESTCAFE_SLACK_USERNAME || 'testcafebot', - loggingLevel: process.env.TESTCAFE_SLACK_LOGGING_LEVEL || loggingLevels.TEST, + loggingLevel: process.env.TESTCAFE_SLACK_LOGGING_LEVEL || LoggingLevels.TEST, quietMode: process.env.TESTCAFE_SLACK_QUIET_MODE || false }; diff --git a/src/const/LoggingLevels.js b/src/const/LoggingLevels.js new file mode 100644 index 0000000..4ae8b25 --- /dev/null +++ b/src/const/LoggingLevels.js @@ -0,0 +1,6 @@ +const LoggingLevels = { + TEST: 'TEST', + SUMMARY: 'SUMMARY' +}; + +export default LoggingLevels; diff --git a/src/const/loggingLevels.js b/src/const/loggingLevels.js deleted file mode 100644 index 070b9ba..0000000 --- a/src/const/loggingLevels.js +++ /dev/null @@ -1,6 +0,0 @@ -const loggingLevels = { - TEST: 'TEST', - SUMMARY: 'SUMMARY' -}; - -export default loggingLevels; diff --git a/src/index.js b/src/index.js index ec7c2ea..29ae6a7 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,10 @@ import config from './config'; import SlackMessage from './SlackMessage'; -import loggingLevels from './const/LoggingLevels'; +import LoggingLevels from './const/LoggingLevels'; import emojis from './utils/emojis'; import { bold, italics } from './utils/textFormatters'; -const {loggingLevel} = config; +const { loggingLevel } = config; export default function () { return { @@ -24,7 +24,7 @@ export default function () { reportFixtureStart(name, path) { this.currentFixtureName = name; - if (loggingLevel === loggingLevels.TEST) this.slack.addMessage(bold(this.currentFixtureName)); + if (loggingLevel === LoggingLevels.TEST) this.slack.addMessage(bold(this.currentFixtureName)); }, reportTestDone(name, testRunInfo) { @@ -40,7 +40,7 @@ export default function () { message = `${emojis.checkMark} ${italics(name)}` } - if (loggingLevel === loggingLevels.TEST) this.slack.addMessage(message); + if (loggingLevel === LoggingLevels.TEST) this.slack.addMessage(message); }, renderErrors(errors) {