-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from archfz/develop
#180: Implement support for mochawesome integration.
- Loading branch information
Showing
13 changed files
with
649 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const CONSTANTS = require("../constants"); | ||
|
||
const PADDING = ' '; | ||
const PADDING_LOGS = `${PADDING}`.repeat(6); | ||
|
||
const padTypeText = (text) => { | ||
return Array(Math.max(PADDING_LOGS.length - text.length + 1, 0)).join(' ') | ||
+ text; | ||
} | ||
|
||
function logsTxtFormatter(logs, EOL = '\n') { | ||
return logs.map(([type, message, severity]) => { | ||
return (padTypeText(`${type} (${{ | ||
[CONSTANTS.SEVERITY.ERROR]: 'X', | ||
[CONSTANTS.SEVERITY.WARNING]: '!', | ||
[CONSTANTS.SEVERITY.SUCCESS]: 'K', | ||
}[severity]}): `) + | ||
message.replace(/\n/g, `${EOL}${PADDING_LOGS}`) + EOL).replace(/\s+\n/, '\n'); | ||
}).join(''); | ||
} | ||
|
||
module.exports = logsTxtFormatter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.