@@ -181,37 +181,22 @@ describe('utils', () => {
181
181
} ) ;
182
182
} ) ;
183
183
184
- describe ( 'validateBstackJson' , ( ) => {
185
- it ( 'should reject with SyntaxError for empty file' , ( ) => {
186
- let bsConfigPath = path . join (
187
- process . cwd ( ) ,
188
- 'test' ,
189
- 'test_files' ,
190
- 'dummy_bstack.json'
191
- ) ;
192
- expect ( utils . validateBstackJson ( bsConfigPath ) ) . to . be . rejectedWith (
193
- SyntaxError
194
- ) ;
195
- } ) ;
196
- it ( 'should resolve with data for valid json' , ( ) => {
197
- let bsConfigPath = path . join (
198
- process . cwd ( ) ,
199
- 'test' ,
200
- 'test_files' ,
201
- 'dummy_bstack_2.json'
202
- ) ;
184
+ describe ( "validateBstackJson" , ( ) => {
185
+ it ( "should reject with SyntaxError for empty file" , ( ) => {
186
+ let bsConfigPath = path . join ( process . cwd ( ) , 'test' , 'test_files' , 'dummy_bstack.json' ) ;
187
+ return utils . validateBstackJson ( bsConfigPath ) . catch ( ( error ) => {
188
+ sinon . match ( error , "Invalid browserstack.json file" )
189
+ } ) ;
190
+ } ) ;
191
+ it ( "should resolve with data for valid json" , ( ) => {
192
+ let bsConfigPath = path . join ( process . cwd ( ) , 'test' , 'test_files' , 'dummy_bstack_2.json' ) ;
203
193
expect ( utils . validateBstackJson ( bsConfigPath ) ) . to . be . eventually . eql ( { } ) ;
204
194
} ) ;
205
- it ( 'should reject with SyntaxError for invalid json file' , ( ) => {
206
- let bsConfigPath = path . join (
207
- process . cwd ( ) ,
208
- 'test' ,
209
- 'test_files' ,
210
- 'dummy_bstack_3.json'
211
- ) ;
212
- expect ( utils . validateBstackJson ( bsConfigPath ) ) . to . be . rejectedWith (
213
- SyntaxError
214
- ) ;
195
+ it ( "should reject with SyntaxError for invalid json file" , ( ) => {
196
+ let bsConfigPath = path . join ( process . cwd ( ) , 'test' , 'test_files' , 'dummy_bstack_3.json' ) ;
197
+ return utils . validateBstackJson ( bsConfigPath ) . catch ( ( error ) => {
198
+ sinon . match ( error , "Invalid browserstack.json file" )
199
+ } ) ;
215
200
} ) ;
216
201
} ) ;
217
202
0 commit comments