Sha256: 03e3f0e1ccde32120ea7bf575b3661901fae88b301ef7a9c4395879498925e47

Contents?: true

Size: 892 Bytes

Versions: 106

Compression:

Stored size: 892 Bytes

Contents

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

Version data entries

106 entries across 105 versions & 9 rubygems

Version Path
immosquare-cleaner-0.1.60 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.59 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.58 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.57 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.56 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.55 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.54 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.53 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.52 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.51 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.50 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.49 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.48 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.47 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.46 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.45 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.44 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.43 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.42 node_modules/text-table/test/ansi-colors.js
immosquare-cleaner-0.1.41 node_modules/text-table/test/ansi-colors.js