From 6d5d4b293295e312ad1370e28f409e5a3ff3fc47 Mon Sep 17 00:00:00 2001 From: soyuka Date: Wed, 28 Jun 2017 20:11:45 +0200 Subject: [PATCH] Add test with array method values --- test/index.test.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/index.test.js b/test/index.test.js index bcf40fa..3921a04 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -284,6 +284,28 @@ module.exports = { '└────────────────────┴─────┘' ] + table.toString().should.eql(expected.join('\n')) + }, + 'test with array method values': function() { + + var table = new Table({ + head: ['pop', 'push', 'slice'], + style: { + head: [], + border: [] + } + }) + + table.push(['push', 'slice', 'pop']) + + var expected = [ + '┌──────┬───────┬───────┐', + '│ pop │ push │ slice │', + '├──────┼───────┼───────┤', + '│ push │ slice │ pop │', + '└──────┴───────┴───────┘' + ] + table.toString().should.eql(expected.join('\n')) } }