File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ function ContextKarma (callParentKarmaMethod) {
66 // Define local variables
77 var hasError = false
88 var self = this
9+ var isLoaded = false
910
1011 // Define our loggers
1112 // DEV: These are intentionally repeated in client and context
@@ -36,7 +37,8 @@ function ContextKarma (callParentKarmaMethod) {
3637 // all files loaded, let's start the execution
3738 this . loaded = function ( ) {
3839 // has error -> cancel
39- if ( ! hasError ) {
40+ if ( ! hasError && ! isLoaded ) {
41+ isLoaded = true
4042 try {
4143 this . start ( this . config )
4244 } catch ( error ) {
Original file line number Diff line number Diff line change @@ -433,5 +433,20 @@ describe('Karma', function () {
433433
434434 assert . equal ( iframe . src , CURRENT_URL )
435435 } )
436+
437+ it ( 'should accept multiple calls to loaded' , function ( ) {
438+ // support for Safari 10 since it supports type=module but not nomodule.
439+ var config = ck . config = {
440+ useIframe : true
441+ }
442+
443+ socket . emit ( 'execute' , config )
444+ assert ( ! startSpy . called )
445+
446+ ck . loaded ( )
447+ ck . loaded ( )
448+ assert ( startSpy . calledWith ( config ) )
449+ assert ( startSpy . getCalls ( ) . length === 1 )
450+ } )
436451 } )
437452} )
You can’t perform that action at this time.
0 commit comments