File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -246,6 +246,7 @@ export class TestBrokerViewModel extends observable.Observable {
246246 //call eval indirectly to execute the scripts in the global scope
247247 var geval = eval ;
248248 geval ( script . contents ) ;
249+ this . completeLoading ( script . url ) ;
249250 }
250251 } ) ;
251252
@@ -333,6 +334,21 @@ export class TestBrokerViewModel extends observable.Observable {
333334 if ( ! global . document . getElementById ) {
334335 global . document . getElementById = id => null ;
335336 }
337+ } else if ( url . indexOf ( 'chai' ) !== - 1 ) {
338+ global . __shim_require = global . require ;
339+ global . require = function ( ) {
340+ throw Error ( ) ;
341+ }
342+
343+ global . window = global ;
344+ }
345+ }
346+
347+ private completeLoading ( url : string ) {
348+ if ( url . indexOf ( 'chai' ) !== - 1 ) {
349+ delete global . window ;
350+ global . require = global . __shim_require ;
351+ delete global . __shim_require ;
336352 }
337353 }
338354}
Original file line number Diff line number Diff line change 11{
22 "name" : " nativescript-unit-test-runner" ,
3- "version" : " 0.1.2 " ,
3+ "version" : " 0.1.3 " ,
44 "description" : " NativeScript unit test runner component." ,
55 "main" : " app.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments