-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
publish_banner.ts
40 lines (30 loc) · 1.05 KB
/
publish_banner.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import chalk from 'chalk'
import Table from 'cli-table3'
const chalkInstance = chalk.stderr
const underlineBoldCyan = (x: string): string =>
chalkInstance.underline(chalkInstance.bold(chalkInstance.cyan(x)))
const formattedReportUrl = underlineBoldCyan('https://reports.cucumber.io')
const formattedEnv =
chalkInstance.cyan('CUCUMBER_PUBLISH_ENABLED') +
'=' +
chalkInstance.cyan('true')
const formattedMoreInfoUrl = underlineBoldCyan(
'https://cucumber.io/docs/cucumber/environment-variables/'
)
const text = `\
Share your Cucumber Report with your team at ${formattedReportUrl}
Command line option: ${chalkInstance.cyan('--publish')}
Environment variable: ${formattedEnv}
More information at ${formattedMoreInfoUrl}
To disable this message, add this to your ${chalkInstance.bold(
'./cucumber.js'
)}:
${chalkInstance.bold("module.exports = { default: '--publish-quiet' }")}`
const table = new Table({
style: {
head: [],
border: chalkInstance.supportsColor ? ['green'] : [],
},
})
table.push([text])
export default table.toString()