aboutsummaryrefslogtreecommitdiff
path: root/tests/printing.test.ts
blob: 6f025c93f0970940b1e4bef7c03debaf81d57979 (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import { Frame } from '../src/index';
import { data, header } from './support/people';

const frame = new Frame(data, header);

describe('printing.test.ts', () => {
  describe('Print a frame', () => {
    it('should print a frame', () => {
      frame.show();
    });
  });
  describe('Print head of a frame', () => {
    it('should print head of a frame', () => {
      frame.head();
    });
    it('should print head of a frame with 2 items', () => {
      frame.data().head(2); // alternatively use: frame.head(2);
    });
  });
  describe('Print tail of a frame', () => {
    it('should print tail of a frame', () => {
      frame.tail();
    });
    it('should print tail of a frame with 2 items', () => {
      frame.data().tail(2); // alternatively use: frame.tail(2);
    });
  });
  describe('Print a column of a frame', () => {
    it('should print a column of a frame using column name', () => {
      frame.column('Name').show();
    });
    it('should print a column of a frame using column index', () => {
      frame.column(0).show();
    });
  });
  describe('Chain everything', () => {
    it('should print the head with 2 times of the "Name" column of the data of a frame', () => {
      frame.data().column('Name').tail(2);
    });
  });
});