1
- const { exec, execSync } = require ( ' child_process' ) ;
1
+ const { exec, execSync } = require ( " child_process" ) ;
2
2
3
- execSync ( "node index client --endpoint 'https://qa.appwrite.org/v1' --projectId console --key=35y3h5h345 --selfSigned true" , { stdio : 'inherit' } ) ;
3
+ execSync (
4
+ "node index client --endpoint 'http://mockapi/v1' --projectId console --key=35y3h5h345 --selfSigned true" ,
5
+ { stdio : "inherit" }
6
+ ) ;
4
7
5
8
var output ;
6
- console . log ( ' \nTest Started' ) ;
9
+ console . log ( " \nTest Started" ) ;
7
10
8
11
// Foo
9
- output = execSync ( "node index foo get --x string --y 123 --z string in array" , { stdio : 'pipe' } ) . toString ( ) ;
10
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
11
-
12
- output = execSync ( "node index foo post --x string --y 123 --z string in array" , { stdio : 'pipe' } ) . toString ( ) ;
13
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
14
-
15
- output = execSync ( "node index foo put --x string --y 123 --z string in array" , { stdio : 'pipe' } ) . toString ( ) ;
16
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
17
-
18
- output = execSync ( "node index foo patch --x string --y 123 --z string in array" , { stdio : 'pipe' } ) . toString ( ) ;
19
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
20
-
21
- output = execSync ( "node index foo delete --x string --y 123 --z string in array" , { stdio : 'pipe' } ) . toString ( ) ;
22
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
12
+ output = execSync (
13
+ "node index foo get --x string --y 123 --z string in array" ,
14
+ { stdio : "pipe" }
15
+ ) . toString ( ) ;
16
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
17
+
18
+ output = execSync (
19
+ "node index foo post --x string --y 123 --z string in array" ,
20
+ { stdio : "pipe" }
21
+ ) . toString ( ) ;
22
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
23
+
24
+ output = execSync (
25
+ "node index foo put --x string --y 123 --z string in array" ,
26
+ { stdio : "pipe" }
27
+ ) . toString ( ) ;
28
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
29
+
30
+ output = execSync (
31
+ "node index foo patch --x string --y 123 --z string in array" ,
32
+ { stdio : "pipe" }
33
+ ) . toString ( ) ;
34
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
35
+
36
+ output = execSync (
37
+ "node index foo delete --x string --y 123 --z string in array" ,
38
+ { stdio : "pipe" }
39
+ ) . toString ( ) ;
40
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
23
41
24
42
// Bar
25
- output = execSync ( "node index bar get --required string --xdefault 123 --z string in array" , { stdio : 'pipe' } ) . toString ( ) ;
26
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
27
-
28
- output = execSync ( "node index bar post --required string --xdefault 123 --z string in array" , { stdio : 'pipe' } ) . toString ( ) ;
29
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
30
-
31
- output = execSync ( "node index bar put --required string --xdefault 123 --z string in array" , { stdio : 'pipe' } ) . toString ( ) ;
32
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
33
-
34
- output = execSync ( "node index bar patch --required string --xdefault 123 --z string in array" , { stdio : 'pipe' } ) . toString ( ) ;
35
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
36
-
37
- output = execSync ( "node index bar delete --required string --xdefault 123 --z string in array" , { stdio : 'pipe' } ) . toString ( ) ;
38
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
43
+ output = execSync (
44
+ "node index bar get --required string --xdefault 123 --z string in array" ,
45
+ { stdio : "pipe" }
46
+ ) . toString ( ) ;
47
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
48
+
49
+ output = execSync (
50
+ "node index bar post --required string --xdefault 123 --z string in array" ,
51
+ { stdio : "pipe" }
52
+ ) . toString ( ) ;
53
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
54
+
55
+ output = execSync (
56
+ "node index bar put --required string --xdefault 123 --z string in array" ,
57
+ { stdio : "pipe" }
58
+ ) . toString ( ) ;
59
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
60
+
61
+ output = execSync (
62
+ "node index bar patch --required string --xdefault 123 --z string in array" ,
63
+ { stdio : "pipe" }
64
+ ) . toString ( ) ;
65
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
66
+
67
+ output = execSync (
68
+ "node index bar delete --required string --xdefault 123 --z string in array" ,
69
+ { stdio : "pipe" }
70
+ ) . toString ( ) ;
71
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
39
72
40
73
// General
41
- output = execSync ( "node index general redirect" , { stdio : ' pipe' } ) . toString ( ) ;
42
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
74
+ output = execSync ( "node index general redirect" , { stdio : " pipe" } ) . toString ( ) ;
75
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
43
76
44
- output = execSync ( "node index general upload --x string --y 123 --z string in array --file ../../resources/file.png" , { stdio : 'pipe' } ) . toString ( ) ;
45
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
77
+ output = execSync (
78
+ "node index general upload --x string --y 123 --z string in array --file ../../resources/file.png" ,
79
+ { stdio : "pipe" }
80
+ ) . toString ( ) ;
81
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
46
82
47
- output = execSync ( "node index general upload --x string --y 123 --z string in array --file ../../resources/large_file.mp4" , { stdio : 'pipe' } ) . toString ( ) ;
48
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
83
+ output = execSync (
84
+ "node index general upload --x string --y 123 --z string in array --file ../../resources/large_file.mp4" ,
85
+ { stdio : "pipe" }
86
+ ) . toString ( ) ;
87
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
49
88
50
89
// Skip extra tests for CLI
51
- console . log ( ' POST:/v1/mock/tests/general/upload:passed' )
52
- console . log ( ' POST:/v1/mock/tests/general/upload:passed' )
90
+ console . log ( " POST:/v1/mock/tests/general/upload:passed" ) ;
91
+ console . log ( " POST:/v1/mock/tests/general/upload:passed" ) ;
53
92
54
- execSync ( "node index general empty" , { stdio : ' pipe' } ) ;
93
+ execSync ( "node index general empty" , { stdio : " pipe" } ) ;
55
94
56
- output = execSync ( "node index general headers" , { stdio : ' pipe' } ) . toString ( ) ;
57
- console . log ( output . split ( '\n' ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
95
+ output = execSync ( "node index general headers" , { stdio : " pipe" } ) . toString ( ) ;
96
+ console . log ( output . split ( "\n" ) [ 0 ] . split ( " : " ) [ 1 ] ) ;
0 commit comments