Skip to content

Commit

Permalink
fix: direct styled header text thru cliux.ux.info (#387)
Browse files Browse the repository at this point in the history
* fix: direct syled header text thru cliux.ux.info

* chore: fix copy paste errors
  • Loading branch information
peternhale authored Mar 4, 2022
1 parent cdf7396 commit 5ebe8de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/cli-ux/styled/header.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// tslint:disable restrict-plus-operands

import * as chalk from 'chalk'
import {CliUx} from '../../index'

export default function styledHeader(header: string) {
process.stdout.write(chalk.dim('=== ') + chalk.bold(header) + '\n')
CliUx.ux.info(chalk.dim('=== ') + chalk.bold(header) + '\n')
}
12 changes: 12 additions & 0 deletions test/cli-ux/styled/header.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import {expect, fancy} from 'fancy-test'

import {CliUx} from '../../../src'

describe('styled/header', () => {
fancy
.stdout()
.end('shows a styled header', output => {
CliUx.ux.styledHeader('A styled header')
expect(output.stdout).to.equal('=== A styled header\n\n')
})
})

0 comments on commit 5ebe8de

Please sign in to comment.