@@ -50,8 +50,17 @@ describe('Local', function () {
5050 } ) ;
5151
5252 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 ) ;
5564 done ( ) ;
5665 } ) ;
5766 } ) ;
@@ -64,63 +73,85 @@ describe('Local', function () {
6473 } ) ;
6574 } ) ;
6675
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+
6784 it ( 'should enable force' , function ( done ) {
6885 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 ) ;
7087 done ( ) ;
7188 } ) ;
7289 } ) ;
7390
7491 it ( 'should enable only' , function ( done ) {
7592 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 ) ;
7794 done ( ) ;
7895 } ) ;
7996 } ) ;
8097
8198 it ( 'should enable onlyAutomate' , function ( done ) {
8299 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 ) ;
84101 done ( ) ;
85102 } ) ;
86103 } ) ;
87104
88105 it ( 'should enable forcelocal' , function ( done ) {
89106 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 ) ;
91115 done ( ) ;
92116 } ) ;
93117 } ) ;
94118
95119 it ( 'should enable custom boolean args' , function ( done ) {
96120 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 ) ;
99123 done ( ) ;
100124 } ) ;
101125 } ) ;
102126
103127 it ( 'should enable custom keyval args' , function ( done ) {
104128 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 ) ;
106130 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 ) ;
108132 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'custom value2' ) ) . to . not . equal ( - 1 ) ;
109133 done ( ) ;
110134 } ) ;
111135 } ) ;
112136
113137 it ( 'should enable forceproxy' , function ( done ) {
114138 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 ) ;
116147 done ( ) ;
117148 } ) ;
118149 } ) ;
119150
120151
121152 it ( 'should set localIdentifier' , function ( done ) {
122153 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 ) ;
124155 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'abcdef' ) ) . to . not . equal ( - 1 ) ;
125156 done ( ) ;
126157 } ) ;
@@ -135,20 +166,21 @@ describe('Local', function () {
135166 'proxyUser' : 'user' ,
136167 'proxyPass' : 'pass'
137168 } , function ( ) {
138- expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '-proxyHost ' ) ) . to . not . equal ( - 1 ) ;
169+ expect ( bsLocal . getBinaryArgs ( ) . indexOf ( '--proxy-host ' ) ) . to . not . equal ( - 1 ) ;
139170 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 ) ;
141172 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 ) ;
143174 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 ) ;
145176 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'pass' ) ) . to . not . equal ( - 1 ) ;
146177 done ( ) ;
147178 } ) ;
148179 } ) ;
149180
150181 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 ) ;
152184 expect ( bsLocal . getBinaryArgs ( ) . indexOf ( 'localhost,8000,0' ) ) . to . not . equal ( - 1 ) ;
153185 done ( ) ;
154186 } ) ;
0 commit comments