1
1
2
- import { expect , test , describe , afterAll , beforeAll , it } from 'vitest'
2
+ import { expect , describe , afterAll , beforeAll , it } from 'vitest'
3
3
import { Tools } from '../../Tools' ;
4
4
import { disposeConnection , newConnection } from '../globalSetup' ;
5
5
import IBMi from '../../IBMi' ;
@@ -15,7 +15,7 @@ describe(`connection tests`, {concurrent: true}, () => {
15
15
disposeConnection ( connection ) ;
16
16
} ) ;
17
17
18
- test ( 'sendCommand' , async ( ) => {
18
+ it ( 'sendCommand' , async ( ) => {
19
19
const result = await connection . sendCommand ( {
20
20
command : `echo "Hello world"` ,
21
21
} ) ;
@@ -24,7 +24,7 @@ describe(`connection tests`, {concurrent: true}, () => {
24
24
expect ( result . stdout ) . toBe ( 'Hello world' ) ;
25
25
} )
26
26
27
- test ( 'sendCommand with home directory' , async ( ) => {
27
+ it ( 'sendCommand with home directory' , async ( ) => {
28
28
const resultA = await connection . sendCommand ( {
29
29
command : `pwd` ,
30
30
directory : `/QSYS.LIB`
@@ -50,7 +50,7 @@ describe(`connection tests`, {concurrent: true}, () => {
50
50
expect ( resultC . stdout ) . not . toBe ( '/badnaughty' ) ;
51
51
} ) ;
52
52
53
- test ( 'sendCommand with environment variables' , async ( ) => {
53
+ it ( 'sendCommand with environment variables' , async ( ) => {
54
54
const result = await connection . sendCommand ( {
55
55
command : `echo "$vara $varB $VARC"` ,
56
56
env : {
@@ -64,7 +64,7 @@ describe(`connection tests`, {concurrent: true}, () => {
64
64
expect ( result . stdout ) . toBe ( 'Hello world cool' ) ;
65
65
} ) ;
66
66
67
- test ( 'getTempRemote' , ( ) => {
67
+ it ( 'getTempRemote' , ( ) => {
68
68
const fileA = connection . getTempRemote ( `/some/file` ) ;
69
69
const fileB = connection . getTempRemote ( `/some/badfile` ) ;
70
70
const fileC = connection . getTempRemote ( `/some/file` ) ;
@@ -73,7 +73,7 @@ describe(`connection tests`, {concurrent: true}, () => {
73
73
expect ( fileA ) . not . toBe ( fileB ) ;
74
74
} )
75
75
76
- test ( 'parseMemberPath (simple)' , ( ) => {
76
+ it ( 'parseMemberPath (simple)' , ( ) => {
77
77
const memberA = connection . parserMemberPath ( `/thelib/thespf/thembr.mbr` ) ;
78
78
79
79
expect ( memberA ?. asp ) . toBeUndefined ( ) ;
@@ -84,7 +84,7 @@ describe(`connection tests`, {concurrent: true}, () => {
84
84
expect ( memberA ?. basename ) . toBe ( `THEMBR.MBR` ) ;
85
85
} )
86
86
87
- test ( 'parseMemberPath (ASP)' , ( ) => {
87
+ it ( 'parseMemberPath (ASP)' , ( ) => {
88
88
const memberA = connection . parserMemberPath ( `/theasp/thelib/thespf/thembr.mbr` ) ;
89
89
90
90
expect ( memberA ?. asp ) . toBe ( `THEASP` ) ;
@@ -95,7 +95,7 @@ describe(`connection tests`, {concurrent: true}, () => {
95
95
expect ( memberA ?. basename ) . toBe ( `THEMBR.MBR` ) ;
96
96
} )
97
97
98
- test ( 'parseMemberPath (no root)' , ( ) => {
98
+ it ( 'parseMemberPath (no root)' , ( ) => {
99
99
const memberA = connection . parserMemberPath ( `thelib/thespf/thembr.mbr` ) ;
100
100
101
101
expect ( memberA ?. asp ) . toBe ( undefined ) ;
@@ -106,7 +106,7 @@ describe(`connection tests`, {concurrent: true}, () => {
106
106
expect ( memberA ?. basename ) . toBe ( `THEMBR.MBR` ) ;
107
107
} ) ;
108
108
109
- test ( 'parseMemberPath (no extension)' , ( ) => {
109
+ it ( 'parseMemberPath (no extension)' , ( ) => {
110
110
const memberA = connection . parserMemberPath ( `/thelib/thespf/thembr` ) ;
111
111
112
112
expect ( memberA ?. asp ) . toBe ( undefined ) ;
@@ -121,13 +121,13 @@ describe(`connection tests`, {concurrent: true}, () => {
121
121
) . toThrow ( `Source Type extension is required.` ) ;
122
122
} ) ;
123
123
124
- test ( 'parseMemberPath (invalid length)' , ( ) => {
124
+ it ( 'parseMemberPath (invalid length)' , ( ) => {
125
125
expect (
126
126
( ) => { connection . parserMemberPath ( `/thespf/thembr.mbr` ) }
127
127
) . toThrow ( `Invalid path: /thespf/thembr.mbr. Use format LIB/SPF/NAME.ext` ) ;
128
128
} ) ;
129
129
130
- test ( 'runCommand (ILE)' , async ( ) => {
130
+ it ( 'runCommand (ILE)' , async ( ) => {
131
131
const result = await connection . runCommand ( {
132
132
command : `DSPJOB OPTION(*DFNA)` ,
133
133
environment : `ile`
@@ -137,7 +137,7 @@ describe(`connection tests`, {concurrent: true}, () => {
137
137
expect ( [ "JOBPTY" , "OUTPTY" , "ENDSEV" , "DDMCNV" , "BRKMSG" , "STSMSG" , "DEVRCYACN" , "TSEPOOL" , "PRTKEYFMT" , "SRTSEQ" ] . every ( attribute => result . stdout . includes ( attribute ) ) ) . toBe ( true ) ;
138
138
} )
139
139
140
- test ( 'runCommand (ILE, with error)' , async ( ) => {
140
+ it ( 'runCommand (ILE, with error)' , async ( ) => {
141
141
const result = await connection . runCommand ( {
142
142
command : `CHKOBJ OBJ(QSYS/NOEXIST) OBJTYPE(*DTAARA)` ,
143
143
noLibList : true
@@ -147,7 +147,7 @@ describe(`connection tests`, {concurrent: true}, () => {
147
147
expect ( result ?. stderr ) . toBeTruthy ( ) ;
148
148
} ) ;
149
149
150
- test ( 'runCommand (ILE, custom library list)' , async ( ) => { const config = connection . getConfig ( ) ;
150
+ it ( 'runCommand (ILE, custom library list)' , async ( ) => { const config = connection . getConfig ( ) ;
151
151
152
152
const ogLibl = config ! . libraryList . slice ( 0 ) ;
153
153
@@ -178,7 +178,7 @@ describe(`connection tests`, {concurrent: true}, () => {
178
178
expect ( resultB . stdout . includes ( `QSYSINC USR` ) ) . toBe ( true ) ;
179
179
} ) ;
180
180
181
- test ( 'runCommand (ILE, library list order from variable)' , async ( ) => {
181
+ it ( 'runCommand (ILE, library list order from variable)' , async ( ) => {
182
182
const result = await connection ?. runCommand ( {
183
183
command : `DSPLIBL` ,
184
184
environment : `ile` ,
@@ -196,7 +196,7 @@ describe(`connection tests`, {concurrent: true}, () => {
196
196
expect ( qtempIndex < qsysincIndex ) . toBeTruthy ( ) ;
197
197
} ) ;
198
198
199
- test ( 'runCommand (ILE, library order from config)' , async ( ) => { const config = connection . getConfig ( ) ;
199
+ it ( 'runCommand (ILE, library order from config)' , async ( ) => { const config = connection . getConfig ( ) ;
200
200
201
201
const ogLibl = config ! . libraryList . slice ( 0 ) ;
202
202
@@ -218,7 +218,7 @@ describe(`connection tests`, {concurrent: true}, () => {
218
218
expect ( qtempIndex < qsysincIndex ) . toBeTruthy ( ) ;
219
219
} ) ;
220
220
221
- test ( 'withTempDirectory and countFiles' , async ( ) => { const content = connection . getContent ( ) ! ;
221
+ it ( 'withTempDirectory and countFiles' , async ( ) => { const content = connection . getContent ( ) ! ;
222
222
let temp ;
223
223
224
224
await connection . withTempDirectory ( async tempDir => {
@@ -246,7 +246,7 @@ describe(`connection tests`, {concurrent: true}, () => {
246
246
}
247
247
} ) ;
248
248
249
- test ( 'upperCaseName' , ( ) => {
249
+ it ( 'upperCaseName' , ( ) => {
250
250
{
251
251
const variantsBackup = connection . variantChars . local ;
252
252
0 commit comments