testbeats
Version:
Publish test results to Microsoft Teams, Google Chat, Slack and InfluxDB
32 lines (26 loc) • 622 B
JavaScript
const { BasePlatform } = require("./base.platform");
class ChatPlatform extends BasePlatform {
/**
* @param {string|number} text
*/
bold(text) {
if (text) {
return `<b>${text}</b>`;
}
return text;
}
break() {
return '<br>';
}
/**
* @param {string[]} items - Array of strings to convert to bullet points
* @returns {string} - Formatted bullet points as a string
*/
bullets(items) {
if (!items || !Array.isArray(items) || items.length === 0) {
return '';
}
return this.merge(items.map(item => `• ${item}`));
}
}
module.exports = { ChatPlatform }