Skip to content

Commit

Permalink
Add test that shows a bug with ansi-tokenize
Browse files Browse the repository at this point in the history
  • Loading branch information
matteodepalo committed Sep 7, 2023
1 parent 9ff9ef9 commit ebf2f9c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import test from 'ava';
import chalk from 'chalk';
import React, {Component, useState} from 'react';
import {spy} from 'sinon';
import ansiEscapes from 'ansi-escapes';
import {
Box,
Newline,
Expand Down Expand Up @@ -720,3 +721,11 @@ test('vertical spacer', t => {

t.is(output, 'Top\n\n\n\n\nBottom');
});

test('ansi escapes are closed properly', t => {
const output = renderToString(
<Text>{ansiEscapes.link('Example', 'https://example.com')}</Text>
);

t.is(output, '"]8;;https://example.comExample]8;;"');
});

0 comments on commit ebf2f9c

Please sign in to comment.