Blame view

node_modules/table/test/README/usage/basic.js 646 Bytes
f7563de62   Palak Handa   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  import table from './../../../src';
  import expectTable from './expectTable';
  
  describe('README.md usage/', () => {
    it('basic', () => {
      const data = [
        ['0A', '0B', '0C'],
        ['1A', '1B', '1C'],
        ['2A', '2B', '2C']
      ];
  
      const output = table(data);
  
      // eslint-disable-next-line no-restricted-syntax
      expectTable(output, `
  ╔════╤════╤════╗
  ║ 0A │ 0B │ 0C ║
  ╟────┼────┼────╢
  ║ 1A │ 1B │ 1C ║
  ╟────┼────┼────╢
  ║ 2A │ 2B │ 2C ║
  ╚════╧════╧════╝
          `);
    });
  });