This commit is contained in:
tatianamac
2019-11-26 14:50:43 -08:00
parent 8a55660ed0
commit 6d5445ecc5
13894 changed files with 2233957 additions and 0 deletions

18
node_modules/text-table/test/align.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
var test = require('tape');
var table = require('../');
test('align', function (t) {
t.plan(1);
var s = table([
[ 'beep', '1024' ],
[ 'boop', '33450' ],
[ 'foo', '1006' ],
[ 'bar', '45' ]
], { align: [ 'l', 'r' ] });
t.equal(s, [
'beep 1024',
'boop 33450',
'foo 1006',
'bar 45'
].join('\n'));
});

32
node_modules/text-table/test/ansi-colors.js generated vendored Normal file
View File

@ -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'));
});

18
node_modules/text-table/test/center.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
var test = require('tape');
var table = require('../');
test('center', function (t) {
t.plan(1);
var s = table([
[ 'beep', '1024', 'xyz' ],
[ 'boop', '3388450', 'tuv' ],
[ 'foo', '10106', 'qrstuv' ],
[ 'bar', '45', 'lmno' ]
], { align: [ 'l', 'c', 'l' ] });
t.equal(s, [
'beep 1024 xyz',
'boop 3388450 tuv',
'foo 10106 qrstuv',
'bar 45 lmno'
].join('\n'));
});

20
node_modules/text-table/test/dotalign.js generated vendored Normal file
View File

@ -0,0 +1,20 @@
var test = require('tape');
var table = require('../');
test('dot align', function (t) {
t.plan(1);
var s = table([
[ 'beep', '1024' ],
[ 'boop', '334.212' ],
[ 'foo', '1006' ],
[ 'bar', '45.6' ],
[ 'baz', '123.' ]
], { align: [ 'l', '.' ] });
t.equal(s, [
'beep 1024',
'boop 334.212',
'foo 1006',
'bar 45.6',
'baz 123.'
].join('\n'));
});

24
node_modules/text-table/test/doubledot.js generated vendored Normal file
View File

@ -0,0 +1,24 @@
var test = require('tape');
var table = require('../');
test('dot align', function (t) {
t.plan(1);
var s = table([
[ '0.1.2' ],
[ '11.22.33' ],
[ '5.6.7' ],
[ '1.22222' ],
[ '12345.' ],
[ '5555.' ],
[ '123' ]
], { align: [ '.' ] });
t.equal(s, [
' 0.1.2',
'11.22.33',
' 5.6.7',
' 1.22222',
'12345.',
' 5555.',
' 123'
].join('\n'));
});

14
node_modules/text-table/test/table.js generated vendored Normal file
View File

@ -0,0 +1,14 @@
var test = require('tape');
var table = require('../');
test('table', function (t) {
t.plan(1);
var s = table([
[ 'master', '0123456789abcdef' ],
[ 'staging', 'fedcba9876543210' ]
]);
t.equal(s, [
'master 0123456789abcdef',
'staging fedcba9876543210'
].join('\n'));
});