Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit ed5d19f

Browse files
authored
chore: fix url hyperlink test (#469)
1 parent cd4e665 commit ed5d19f

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
],
66
"rules": {
77
"unicorn/no-abusive-eslint-disable": 1,
8-
"unicorn/prefer-node-protocol":0,
8+
"unicorn/prefer-node-protocol": 0,
99
"unicorn/import-style": 1,
1010
"unicorn/no-array-reduce": 1
1111
}

test/index.test.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,25 @@
11
import ux from '../src'
22

33
import {expect, fancy} from './fancy'
4+
// eslint-disable-next-line unicorn/prefer-module
5+
const hyperlinker = require('hyperlinker')
46

5-
process.env.FORCE_HYPERLINK = '1'
6-
7-
describe.skip('prompt', () => {
7+
describe('url', () => {
88
fancy
9+
.env({FORCE_HYPERLINK: '1'}, {clear: true})
910
.stdout()
1011
.do(() => ux.url('sometext', 'https://google.com'))
1112
.it('renders hyperlink', async ({stdout}) => {
12-
expect(stdout).to.equal('ttps://google.com\u0007sometext\n')
13+
expect(stdout).to.equal('sometext\n')
14+
})
15+
})
16+
17+
describe('hyperlinker', () => {
18+
fancy
19+
.it('renders hyperlink', async () => {
20+
const link = hyperlinker('sometext', 'https://google.com', {})
21+
// eslint-disable-next-line unicorn/escape-case
22+
const expected = '\u001b]8;;https://google.com\u0007sometext\u001b]8;;\u0007'
23+
expect(link).to.equal(expected)
1324
})
1425
})

0 commit comments

Comments
 (0)