@@ -50,8 +50,17 @@ describe('Local', function () {
50
50
} ) ;
51
51
52
52
it ( 'should enable verbose' , function ( done ) {
53
- bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'v' : true } , function ( ) {
54
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-vvv' ) ) . to . not . equal ( - 1 ) ;
53
+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'verbose' : true } , function ( ) {
54
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--verbose' ) ) . to . not . equal ( - 1 ) ;
55
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '1' ) ) . to . not . equal ( - 1 ) ;
56
+ done ( ) ;
57
+ } ) ;
58
+ } ) ;
59
+
60
+ it ( 'should enable verbose with log level' , function ( done ) {
61
+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'verbose' : 2 } , function ( ) {
62
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--verbose' ) ) . to . not . equal ( - 1 ) ;
63
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '2' ) ) . to . not . equal ( - 1 ) ;
55
64
done ( ) ;
56
65
} ) ;
57
66
} ) ;
@@ -64,63 +73,85 @@ describe('Local', function () {
64
73
} ) ;
65
74
} ) ;
66
75
76
+ it ( 'should set folder testing with folder option' , function ( done ) {
77
+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'folder' : '/var/html' } , function ( ) {
78
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-f' ) ) . to . not . equal ( - 1 ) ;
79
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '/var/html' ) ) . to . not . equal ( - 1 ) ;
80
+ done ( ) ;
81
+ } ) ;
82
+ } ) ;
83
+
67
84
it ( 'should enable force' , function ( done ) {
68
85
bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'force' : true } , function ( ) {
69
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-force' ) ) . to . not . equal ( - 1 ) ;
86
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-- force' ) ) . to . not . equal ( - 1 ) ;
70
87
done ( ) ;
71
88
} ) ;
72
89
} ) ;
73
90
74
91
it ( 'should enable only' , function ( done ) {
75
92
bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'only' : true } , function ( ) {
76
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-only' ) ) . to . not . equal ( - 1 ) ;
93
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-- only' ) ) . to . not . equal ( - 1 ) ;
77
94
done ( ) ;
78
95
} ) ;
79
96
} ) ;
80
97
81
98
it ( 'should enable onlyAutomate' , function ( done ) {
82
99
bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'onlyAutomate' : true } , function ( ) {
83
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-onlyAutomate ' ) ) . to . not . equal ( - 1 ) ;
100
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--only-automate ' ) ) . to . not . equal ( - 1 ) ;
84
101
done ( ) ;
85
102
} ) ;
86
103
} ) ;
87
104
88
105
it ( 'should enable forcelocal' , function ( done ) {
89
106
bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'forcelocal' : true } , function ( ) {
90
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-forcelocal' ) ) . to . not . equal ( - 1 ) ;
107
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--force-local' ) ) . to . not . equal ( - 1 ) ;
108
+ done ( ) ;
109
+ } ) ;
110
+ } ) ;
111
+
112
+ it ( 'should enable forcelocal with camel case' , function ( done ) {
113
+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'forceLocal' : true } , function ( ) {
114
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--force-local' ) ) . to . not . equal ( - 1 ) ;
91
115
done ( ) ;
92
116
} ) ;
93
117
} ) ;
94
118
95
119
it ( 'should enable custom boolean args' , function ( done ) {
96
120
bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'boolArg1' : true , 'boolArg2' : true } , function ( ) {
97
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-boolArg1' ) ) . to . not . equal ( - 1 ) ;
98
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-boolArg2' ) ) . to . not . equal ( - 1 ) ;
121
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-- boolArg1' ) ) . to . not . equal ( - 1 ) ;
122
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-- boolArg2' ) ) . to . not . equal ( - 1 ) ;
99
123
done ( ) ;
100
124
} ) ;
101
125
} ) ;
102
126
103
127
it ( 'should enable custom keyval args' , function ( done ) {
104
128
bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'customKey1' : 'custom value1' , 'customKey2' : 'custom value2' } , function ( ) {
105
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-customKey1' ) ) . to . not . equal ( - 1 ) ;
129
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-- customKey1' ) ) . to . not . equal ( - 1 ) ;
106
130
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'custom value1' ) ) . to . not . equal ( - 1 ) ;
107
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-customKey2' ) ) . to . not . equal ( - 1 ) ;
131
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-- customKey2' ) ) . to . not . equal ( - 1 ) ;
108
132
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'custom value2' ) ) . to . not . equal ( - 1 ) ;
109
133
done ( ) ;
110
134
} ) ;
111
135
} ) ;
112
136
113
137
it ( 'should enable forceproxy' , function ( done ) {
114
138
bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'forceproxy' : true } , function ( ) {
115
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-forceproxy' ) ) . to . not . equal ( - 1 ) ;
139
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--force-proxy' ) ) . to . not . equal ( - 1 ) ;
140
+ done ( ) ;
141
+ } ) ;
142
+ } ) ;
143
+
144
+ it ( 'should enable forceproxy with camel case' , function ( done ) {
145
+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'forceProxy' : true } , function ( ) {
146
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--force-proxy' ) ) . to . not . equal ( - 1 ) ;
116
147
done ( ) ;
117
148
} ) ;
118
149
} ) ;
119
150
120
151
121
152
it ( 'should set localIdentifier' , function ( done ) {
122
153
bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'localIdentifier' : 'abcdef' } , function ( ) {
123
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-localIdentifier ' ) ) . to . not . equal ( - 1 ) ;
154
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--local-identifier ' ) ) . to . not . equal ( - 1 ) ;
124
155
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'abcdef' ) ) . to . not . equal ( - 1 ) ;
125
156
done ( ) ;
126
157
} ) ;
@@ -135,20 +166,21 @@ describe('Local', function () {
135
166
'proxyUser' : 'user' ,
136
167
'proxyPass' : 'pass'
137
168
} , function ( ) {
138
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-proxyHost ' ) ) . to . not . equal ( - 1 ) ;
169
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--proxy-host ' ) ) . to . not . equal ( - 1 ) ;
139
170
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'localhost' ) ) . to . not . equal ( - 1 ) ;
140
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-proxyPort ' ) ) . to . not . equal ( - 1 ) ;
171
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--proxy-port ' ) ) . to . not . equal ( - 1 ) ;
141
172
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 8080 ) ) . to . not . equal ( - 1 ) ;
142
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-proxyUser ' ) ) . to . not . equal ( - 1 ) ;
173
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--proxy-user ' ) ) . to . not . equal ( - 1 ) ;
143
174
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'user' ) ) . to . not . equal ( - 1 ) ;
144
- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-proxyPass ' ) ) . to . not . equal ( - 1 ) ;
175
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--proxy-pass ' ) ) . to . not . equal ( - 1 ) ;
145
176
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'pass' ) ) . to . not . equal ( - 1 ) ;
146
177
done ( ) ;
147
178
} ) ;
148
179
} ) ;
149
180
150
181
it ( 'should set hosts' , function ( done ) {
151
- bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : true , 'hosts' : 'localhost,8000,0' } , function ( ) {
182
+ bsLocal . start ( { 'key' : process . env . BROWSERSTACK_ACCESS_KEY , onlyCommand : 'localhost,8000,0' } , function ( ) {
183
+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--only' ) ) . to . not . equal ( - 1 ) ;
152
184
expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'localhost,8000,0' ) ) . to . not . equal ( - 1 ) ;
153
185
done ( ) ;
154
186
} ) ;
0 commit comments