Skip to content

Commit 40b253f

Browse files
committed
Remove tests that are covered by e2e and hard to maintain
1 parent 7637705 commit 40b253f

File tree

1 file changed

+25
-143
lines changed

1 file changed

+25
-143
lines changed

__tests__/cast.test.ts

Lines changed: 25 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@ describe('cast', () => {
66
cast(
77
{
88
name: 'email',
9-
type: 'VARCHAR',
10-
table: 'users',
11-
orgTable: 'users',
12-
database: 'database-js',
13-
orgName: 'email',
14-
columnLength: 1020,
15-
charset: 255
9+
type: 'VARCHAR'
1610
},
1711
null
1812
)
@@ -24,72 +18,43 @@ describe('cast', () => {
2418
cast(
2519
{
2620
name: 'id',
27-
type: 'UINT64',
28-
table: 'users',
29-
orgTable: 'users',
30-
database: 'database-js',
31-
orgName: 'id',
32-
columnLength: 20,
33-
charset: 63,
34-
flags: 49699
21+
type: 'UINT64'
3522
},
3623
'1'
3724
)
3825
).toEqual('1')
3926
})
4027

41-
test('casts DECIMAL values', () => {
28+
test('casts DATETIME, DATE, TIMESTAMP, TIME values', () => {
4229
expect(
4330
cast(
4431
{
45-
name: 'decimal',
46-
type: 'DECIMAL',
47-
table: 'decimals',
48-
orgTable: 'decimals',
49-
database: 'blob',
50-
orgName: 'decimal',
51-
columnLength: 12,
52-
charset: 63,
53-
decimals: 2,
54-
flags: 32768
32+
name: 'created_at',
33+
type: 'DATETIME'
5534
},
56-
'5.4'
35+
'2024-01-01 00:00:00'
5736
)
58-
).toEqual('5.4')
37+
).toEqual('2024-01-01 00:00:00')
5938
})
6039

61-
test('casts DATETIME, DATE, TIMESTAMP, TIME values', () => {
40+
test('casts DECIMAL values', () => {
6241
expect(
6342
cast(
6443
{
65-
name: 'created_at',
66-
type: 'DATETIME',
67-
table: 'users',
68-
orgTable: 'users',
69-
database: 'database-js',
70-
orgName: 'created_at',
71-
columnLength: 19,
72-
charset: 63,
73-
flags: 128
44+
name: 'decimal',
45+
type: 'DECIMAL'
7446
},
75-
'2024-01-01 00:00:00'
47+
'5.4'
7648
)
77-
).toEqual('2024-01-01 00:00:00')
49+
).toEqual('5.4')
7850
})
7951

8052
test('casts JSON values', () => {
8153
expect(
8254
cast(
8355
{
8456
name: 'metadata',
85-
type: 'JSON',
86-
table: 'users',
87-
orgTable: 'users',
88-
database: 'database-js',
89-
orgName: 'metadata',
90-
columnLength: 4294967295,
91-
charset: 63,
92-
flags: 144
57+
type: 'JSON'
9358
},
9459
'{ "color": "blue" }'
9560
)
@@ -101,14 +66,7 @@ describe('cast', () => {
10166
cast(
10267
{
10368
name: 'verified',
104-
type: 'INT8',
105-
table: 'users',
106-
orgTable: 'users',
107-
database: 'database-js',
108-
orgName: 'verified',
109-
columnLength: 1,
110-
charset: 63,
111-
flags: 32768
69+
type: 'INT8'
11270
},
11371
'1'
11472
)
@@ -117,14 +75,7 @@ describe('cast', () => {
11775
cast(
11876
{
11977
name: 'age',
120-
type: 'INT32',
121-
table: 'users',
122-
orgTable: 'users',
123-
database: 'database-js',
124-
orgName: 'age',
125-
columnLength: 11,
126-
charset: 63,
127-
flags: 32768
78+
type: 'INT32'
12879
},
12980
'21'
13081
)
@@ -136,15 +87,7 @@ describe('cast', () => {
13687
cast(
13788
{
13889
name: 'float',
139-
type: 'FLOAT32',
140-
table: 'decimals',
141-
orgTable: 'decimals',
142-
database: 'blob',
143-
orgName: 'float',
144-
columnLength: 12,
145-
charset: 63,
146-
decimals: 31,
147-
flags: 32768
90+
type: 'FLOAT32'
14891
},
14992
'20.4'
15093
)
@@ -153,91 +96,30 @@ describe('cast', () => {
15396
cast(
15497
{
15598
name: 'double',
156-
type: 'FLOAT64',
157-
table: 'decimals',
158-
orgTable: 'decimals',
159-
database: 'blob',
160-
orgName: 'double',
161-
columnLength: 22,
162-
charset: 63,
163-
decimals: 31,
164-
flags: 32768
99+
type: 'FLOAT64'
165100
},
166101
'101.4'
167102
)
168103
).toEqual(101.4)
169104
})
170105

171-
test('casts VARCHAR values', () => {
172-
expect(
173-
cast(
174-
{
175-
name: 'email',
176-
type: 'VARCHAR',
177-
table: 'users',
178-
orgTable: 'users',
179-
database: 'database-js',
180-
orgName: 'email',
181-
columnLength: 1020,
182-
charset: 255
183-
},
184-
185-
)
186-
).toEqual('[email protected]')
187-
})
188-
189106
test('casts BLOB, BIT, GEOMETRY, BINARY, VARBINARY values', () => {
190-
/** See e2e tests for more complete assertions */
191-
192-
expect(
193-
cast(
194-
{
195-
name: 'bytes',
196-
type: 'BLOB',
197-
table: 'binary_test',
198-
orgTable: 'binary_test',
199-
database: 'database-js',
200-
orgName: 'bytes',
201-
columnLength: 4294967295,
202-
charset: 63,
203-
flags: 4241
204-
},
205-
'\u0001\u0002\u0003'
206-
)
207-
).toEqual(new Uint8Array([1, 2, 3]))
107+
/** See e2e tests. */
208108
})
209109

210110
test('casts BINARY, VARBINARY string values', () => {
211-
/** See e2e tests for more complete assertions */
111+
/** See e2e tests. */
112+
})
212113

114+
test('casts VARCHAR values', () => {
213115
expect(
214116
cast(
215117
{
216-
name: 'Index_type',
217-
type: 'VARBINARY',
218-
table: 'SHOW_STATISTICS',
219-
orgName: 'Index_type',
220-
columnLength: 44,
221-
charset: 255,
222-
flags: 129
223-
},
224-
'BTREE'
225-
)
226-
).toEqual('BTREE')
227-
expect(
228-
cast(
229-
{
230-
name: 'Tables_in_users',
231-
type: 'VARBINARY',
232-
table: 'TABLES',
233-
orgTable: 'tables',
234-
orgName: 'Tables_in_users',
235-
columnLength: 256,
236-
charset: 255,
237-
flags: 4225
118+
name: 'email',
119+
type: 'VARCHAR'
238120
},
239-
'users'
121+
240122
)
241-
).toEqual('users')
123+
).toEqual('[email protected]')
242124
})
243125
})

0 commit comments

Comments
 (0)