summaryrefslogtreecommitdiff
path: root/tools/eslint/node_modules/text-table/test/ansi-colors.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/eslint/node_modules/text-table/test/ansi-colors.js')
-rw-r--r--tools/eslint/node_modules/text-table/test/ansi-colors.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/eslint/node_modules/text-table/test/ansi-colors.js b/tools/eslint/node_modules/text-table/test/ansi-colors.js
new file mode 100644
index 0000000000..fbc5bb10ad
--- /dev/null
+++ b/tools/eslint/node_modules/text-table/test/ansi-colors.js
@@ -0,0 +1,32 @@
+var test = require('tape');
+var table = require('../');
+var color = require('cli-color');
+var ansiTrim = require('cli-color/lib/trim');
+
+test('center', function (t) {
+ t.plan(1);
+ var opts = {
+ align: [ 'l', 'c', 'l' ],
+ stringLength: function(s) { return ansiTrim(s).length }
+ };
+ var s = table([
+ [
+ color.red('Red'), color.green('Green'), color.blue('Blue')
+ ],
+ [
+ color.bold('Bold'), color.underline('Underline'),
+ color.italic('Italic')
+ ],
+ [
+ color.inverse('Inverse'), color.strike('Strike'),
+ color.blink('Blink')
+ ],
+ [ 'bar', '45', 'lmno' ]
+ ], opts);
+ t.equal(ansiTrim(s), [
+ 'Red Green Blue',
+ 'Bold Underline Italic',
+ 'Inverse Strike Blink',
+ 'bar 45 lmno'
+ ].join('\n'));
+});