node-clinic/test/help-formatter.test.js
Rafael Gonzaga 87e8a215dc
chore: add ci support node 16 (#292)
* chore: bump tap version

* chore: add v16 to test matrix

* chore: update coverage settings to latest tap version

* chore: use taprc

* chore: support v17

* chore: updade coverage settings
2021-10-28 09:41:21 -03:00

26 lines
641 B
JavaScript

'use strict'
const test = require('tap').test
const helpFormatter = require('../lib/help-formatter.js')
test('help formatter', function (t) {
t.equal(helpFormatter('Title v{{version}}', '1.2.3'), 'Title v1.2.3')
t.equal(
helpFormatter('<title>TITLE</title>', '1.0.0'),
'\x1B[37m\x1B[1m\x1B[4mTITLE\x1B[24m\x1B[22m\x1B[39m'
)
t.equal(
helpFormatter('<h1>HEADER</h1>', '1.0.0'),
'\x1B[36m\x1B[1mHEADER\x1B[22m\x1B[39m'
)
t.equal(
helpFormatter('<code>CODE</code>', '1.0.0'),
'\x1B[33mCODE\x1B[39m'
)
t.equal(
helpFormatter('<link>CODE</link>', '1.0.0'),
'\x1B[4mCODE\x1B[24m'
)
t.end()
})