@@ -8,6 +8,9 @@ import { Exec } from './exec';
8
8
import { WebSocketHandler , WebSocketInterface } from './web-socket-handler' ;
9
9
10
10
describe ( 'Exec' , ( ) => {
11
+ // tslint:disable-next-line:no-empty
12
+ const nop = ( ) => { } ;
13
+
11
14
describe ( 'basic' , ( ) => {
12
15
it ( 'should correctly exec to a url' , async ( ) => {
13
16
const kc = new KubeConfig ( ) ;
@@ -24,27 +27,27 @@ describe('Exec', () => {
24
27
const path = `/api/v1/namespaces/${ namespace } /pods/${ pod } /exec` ;
25
28
26
29
await exec . exec (
27
- namespace , pod , container , cmd , osStream , errStream , isStream , false ) ;
30
+ namespace , pod , container , cmd , osStream , errStream , isStream , nop , false ) ;
28
31
let args = `stdout=true&stderr=true&stdin=true&tty=false&command=${ cmd } &container=${ container } ` ;
29
32
verify ( fakeWebSocket . connect ( `${ path } ?${ args } ` , null , anyFunction ( ) ) ) . called ( ) ;
30
33
31
34
await exec . exec (
32
- namespace , pod , container , cmd , null , errStream , isStream , false ) ;
35
+ namespace , pod , container , cmd , null , errStream , isStream , nop , false ) ;
33
36
args = `stdout=false&stderr=true&stdin=true&tty=false&command=${ cmd } &container=${ container } ` ;
34
37
verify ( fakeWebSocket . connect ( `${ path } ?${ args } ` , null , anyFunction ( ) ) ) . called ( ) ;
35
38
36
39
await exec . exec (
37
- namespace , pod , container , cmd , null , null , isStream , false ) ;
40
+ namespace , pod , container , cmd , null , null , isStream , nop , false ) ;
38
41
args = `stdout=false&stderr=false&stdin=true&tty=false&command=${ cmd } &container=${ container } ` ;
39
42
verify ( fakeWebSocket . connect ( `${ path } ?${ args } ` , null , anyFunction ( ) ) ) . called ( ) ;
40
43
41
44
await exec . exec (
42
- namespace , pod , container , cmd , null , null , null , false ) ;
45
+ namespace , pod , container , cmd , null , null , null , nop , false ) ;
43
46
args = `stdout=false&stderr=false&stdin=false&tty=false&command=${ cmd } &container=${ container } ` ;
44
47
verify ( fakeWebSocket . connect ( `${ path } ?${ args } ` , null , anyFunction ( ) ) ) . called ( ) ;
45
48
46
49
await exec . exec (
47
- namespace , pod , container , cmd , null , errStream , isStream , true ) ;
50
+ namespace , pod , container , cmd , null , errStream , isStream , nop , true ) ;
48
51
args = `stdout=false&stderr=true&stdin=true&tty=true&command=${ cmd } &container=${ container } ` ;
49
52
verify ( fakeWebSocket . connect ( `${ path } ?${ args } ` , null , anyFunction ( ) ) ) . called ( ) ;
50
53
} ) ;
@@ -69,7 +72,7 @@ describe('Exec', () => {
69
72
when ( fakeWebSocket . connect ( `${ path } ?${ args } ` , null , anyFunction ( ) ) ) . thenResolve ( fakeConn ) ;
70
73
71
74
await exec . exec (
72
- namespace , pod , container , cmd , osStream , errStream , isStream , false ) ;
75
+ namespace , pod , container , cmd , osStream , errStream , isStream , nop , false ) ;
73
76
74
77
const [ , , outputFn ] = capture ( fakeWebSocket . connect ) . last ( ) ;
75
78
0 commit comments