Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Commit

Permalink
Rename LoggingLevels file (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinlesek authored Apr 25, 2019
1 parent 64770e6 commit 36abaec
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/SlackMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions lib/const/LoggingLevels.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
2 changes: 1 addition & 1 deletion src/SlackMessage.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import config from './config';
import loggingLevels from "./const/loggingLevels";
import loggingLevels from "./const/LoggingLevels";

export default class SlackMessage {
constructor() {
Expand Down
4 changes: 2 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down
6 changes: 6 additions & 0 deletions src/const/LoggingLevels.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const LoggingLevels = {
TEST: 'TEST',
SUMMARY: 'SUMMARY'
};

export default LoggingLevels;
6 changes: 0 additions & 6 deletions src/const/loggingLevels.js

This file was deleted.

8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 36abaec

Please sign in to comment.