react / wstein / node_modules / jest-cli / node_modules / cover / node_modules / cli-table / test / index.test.js
80682 views1/**2* Module requirements.3*/45require('./common');67var Table = require('cli-table');89/**10* Tests.11*/1213module.exports = {1415'test complete table': function (){16var table = new Table({17head: ['Rel', 'Change', 'By', 'When']18, style: {19'padding-left': 120, 'padding-right': 121}22, colWidths: [6, 21, 25, 17]23});2425table.push(26['v0.1', 'Testing something cool', '[email protected]', '7 minutes ago']27, ['v0.1', 'Testing something cool', '[email protected]', '8 minutes ago']28);2930var expected = [31'┏━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓'32, '┃ Rel ┃ Change ┃ By ┃ When ┃'33, '┣━━━━━━╋━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━┫'34, '┃ v0.1 ┃ Testing something … ┃ [email protected] ┃ 7 minutes ago ┃'35, '┣━━━━━━╋━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━┫'36, '┃ v0.1 ┃ Testing something … ┃ [email protected] ┃ 8 minutes ago ┃'37, '┗━━━━━━┻━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━┛'38];3940table.toString().should.eql(expected.join("\n"));41},4243'test width property': function (){44var table = new Table({45head: ['Cool']46});4748table.width.should.eql(8);49}5051};525354