align.js 393 B

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