• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1var test = require('tape');
2var table = require('../');
3
4test('dot align', function (t) {
5    t.plan(1);
6    var s = table([
7        [ 'beep', '1024' ],
8        [ 'boop', '334.212' ],
9        [ 'foo', '1006' ],
10        [ 'bar', '45.6' ],
11        [ 'baz', '123.' ]
12    ], { align: [ 'l', '.' ] });
13    t.equal(s, [
14        'beep  1024',
15        'boop   334.212',
16        'foo   1006',
17        'bar     45.6',
18        'baz    123.'
19    ].join('\n'));
20});
21