center.js 466 B

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