File: test.js

package info (click to toggle)
node-strip-ansi 5.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 128 kB
  • sloc: makefile: 2
file content (14 lines) | stat: -rw-r--r-- 517 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var m = require('.');
var assert = require('assert');

test('strip color from string', function() {
    assert(m('\u001B[0m\u001B[4m\u001B[42m\u001B[31mfoo\u001B[39m\u001B[49m\u001B[24mfoo\u001B[0m') === 'foofoo');
});

test('strip color from ls command', function() {
    assert(m('\u001B[00;38;5;244m\u001B[m\u001B[00;38;5;33mfoo\u001B[0m') === 'foo');
});

test('strip reset;setfg;setbg;italics;strike;underline sequence from string', function() {
    assert(m('\u001B[0;33;49;3;9;4mbar\u001B[0m') === 'bar');
});