dotalign.js 453 B

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