@@ -8,64 +8,6 @@ import { expect } from 'chai';
8
8
import stripAnsi from 'strip-ansi' ;
9
9
import { table } from '../../../src/ux/table.js' ;
10
10
11
- /* eslint-disable camelcase */
12
- const apps = [
13
- {
14
- build_stack : {
15
- id : '123' ,
16
- name : 'heroku-16' ,
17
- } ,
18
- created_at : '2000-01-01T22:34:46Z' ,
19
- id : '123' ,
20
- git_url : 'https://git.heroku.com/supertable-test-1.git' ,
21
- name : 'supertable-test-1' ,
22
- owner : {
23
- email : 'example@heroku.com' ,
24
- id : '1' ,
25
- } ,
26
- region : { id : '123' , name : 'us' } ,
27
- released_at : '2000-01-01T22:34:46Z' ,
28
- stack : {
29
- id : '123' ,
30
- name : 'heroku-16' ,
31
- } ,
32
- updated_at : '2000-01-01T22:34:46Z' ,
33
- web_url : 'https://supertable-test-1.herokuapp.com/' ,
34
- } ,
35
- {
36
- build_stack : {
37
- id : '321' ,
38
- name : 'heroku-16' ,
39
- } ,
40
- created_at : '2000-01-01T22:34:46Z' ,
41
- id : '321' ,
42
- git_url : 'https://git.heroku.com/phishing-demo.git' ,
43
- name : 'supertable-test-2' ,
44
- owner : {
45
- email : 'example@heroku.com' ,
46
- id : '1' ,
47
- } ,
48
- region : { id : '321' , name : 'us' } ,
49
- released_at : '2000-01-01T22:34:46Z' ,
50
- stack : {
51
- id : '321' ,
52
- name : 'heroku-16' ,
53
- } ,
54
- updated_at : '2000-01-01T22:34:46Z' ,
55
- web_url : 'https://supertable-test-2.herokuapp.com/' ,
56
- } ,
57
- ] ;
58
-
59
- const columns = {
60
- id : { header : 'ID' } ,
61
- name : { } ,
62
- web_url : { extended : true } ,
63
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access
64
- stack : { extended : true , get : ( r : any ) => r . stack ?. name } ,
65
- } ;
66
-
67
- const ws = ' ' ;
68
-
69
11
describe ( 'table' , ( ) => {
70
12
let output = '' ;
71
13
function printLine ( line : string ) {
@@ -76,15 +18,6 @@ describe('table', () => {
76
18
output = '' ;
77
19
} ) ;
78
20
79
- // This can't be in the unit tests since wireit changes process.stdout.isTTY, which alters the behavior of table
80
- it ( 'should not truncate in TTY env' , ( ) => {
81
- const three = { ...apps [ 0 ] , id : '0' . repeat ( 80 ) , name : 'supertable-test-3' } ;
82
- table ( [ ...apps , three ] , columns , { filter : 'id=0' , printLine, truncate : false } ) ;
83
- expect ( output ) . to . equal ( ` ID${ ws . padEnd ( 78 ) } Name${ ws . padEnd ( 14 ) }
84
- ${ '' . padEnd ( three . id . length , '─' ) } ─────────────────${ ws }
85
- ${ three . id } supertable-test-3${ ws } \n` ) ;
86
- } ) ;
87
-
88
21
it ( 'does not exceed stack depth on very tall tables' , ( ) => {
89
22
const data = Array . from ( { length : 150_000 } ) . fill ( { id : '123' , name : 'foo' , value : 'bar' } ) as Array <
90
23
Record < string , unknown >
0 commit comments