Skip to content

Commit 53e059d

Browse files
committed
Add test for #43
Fixes #43
1 parent c51e288 commit 53e059d

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"text"
5050
],
5151
"dependencies": {
52-
"ansi-regex": "^6.0.1"
52+
"ansi-regex": "^6.2.2"
5353
},
5454
"devDependencies": {
5555
"ava": "^3.15.0",

test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ test('strip reset;setfg;setbg;italics;strike;underline sequence from string', t
1616
test('strip link from terminal link', t => {
1717
t.is(stripAnsi('\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'), 'click');
1818
});
19+
20+
test('strip OSC sequence with BEL terminator', t => {
21+
const input = '\u001B[2J\u001B[m\u001B[HABC\r\n\u001B]0;C:\\WINDOWS\\system32\\cmd.exe\u0007\u001B[?25h';
22+
const output = stripAnsi(input);
23+
t.is(output, 'ABC\r\n');
24+
});

0 commit comments

Comments
 (0)