You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
453 B

4 years ago
  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. });