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

Commit

Permalink
chore: fix url hyperlink test (#469)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Dec 16, 2021
1 parent cd4e665 commit ed5d19f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Expand Up @@ -5,7 +5,7 @@
],
"rules": {
"unicorn/no-abusive-eslint-disable": 1,
"unicorn/prefer-node-protocol":0,
"unicorn/prefer-node-protocol": 0,
"unicorn/import-style": 1,
"unicorn/no-array-reduce": 1
}
Expand Down
19 changes: 15 additions & 4 deletions test/index.test.ts
@@ -1,14 +1,25 @@
import ux from '../src'

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

process.env.FORCE_HYPERLINK = '1'

describe.skip('prompt', () => {
describe('url', () => {
fancy
.env({FORCE_HYPERLINK: '1'}, {clear: true})
.stdout()
.do(() => ux.url('sometext', 'https://google.com'))
.it('renders hyperlink', async ({stdout}) => {
expect(stdout).to.equal('ttps://google.com\u0007sometext\n')
expect(stdout).to.equal('sometext\n')
})
})

describe('hyperlinker', () => {
fancy
.it('renders hyperlink', async () => {
const link = hyperlinker('sometext', 'https://google.com', {})
// eslint-disable-next-line unicorn/escape-case
const expected = '\u001b]8;;https://google.com\u0007sometext\u001b]8;;\u0007'
expect(link).to.equal(expected)
})
})

0 comments on commit ed5d19f

Please sign in to comment.