File tree Expand file tree Collapse file tree
base-components/automatic-tests/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,8 +2,12 @@ function(el) {
22 var testRunners = document . querySelectorAll ( ".simplycode-component[open] iframe.qunit" ) ;
33 testRunners . forEach ( function ( testRunner ) {
44 testRunner . contentWindow . document . testRunner = testRunner ;
5- testRunner . contentWindow . document . open ( ) ;
6- testRunner . contentWindow . document . write ( testRunner . parentNode . querySelector ( ".qunit-code" ) . innerText ) ;
7- testRunner . contentWindow . document . close ( ) ;
5+ simplyApp . commands . resetTests ( testRunner )
6+ . then ( function ( testRunner ) {
7+ testRunner . contentWindow . document . testRunner = testRunner ;
8+ testRunner . contentWindow . document . open ( ) ;
9+ testRunner . contentWindow . document . write ( testRunner . parentNode . querySelector ( ".qunit-code" ) . innerText ) ;
10+ testRunner . contentWindow . document . close ( ) ;
11+ } ) ;
812 } ) ;
913}
Original file line number Diff line number Diff line change 1+ function ( el ) {
2+ return new Promise ( function ( resolve , reject ) {
3+ var newRunner = el . cloneNode ( false ) ;
4+ newRunner . addEventListener ( "load" , function ( ) {
5+ resolve ( newRunner ) ;
6+ } ) ;
7+ el . parentNode . insertBefore ( newRunner , el ) ;
8+ el . remove ( ) ;
9+ } ) ;
10+ }
Original file line number Diff line number Diff line change 30013001 var testRunners = document . querySelectorAll ( ".simplycode-component[open] iframe.qunit" ) ;
30023002 testRunners . forEach ( function ( testRunner ) {
30033003 testRunner . contentWindow . document . testRunner = testRunner ;
3004- testRunner . contentWindow . document . open ( ) ;
3005- testRunner . contentWindow . document . write ( testRunner . parentNode . querySelector ( ".qunit-code" ) . innerText ) ;
3006- testRunner . contentWindow . document . close ( ) ;
3004+ simplyApp . commands . resetTests ( testRunner )
3005+ . then ( function ( testRunner ) {
3006+ testRunner . contentWindow . document . testRunner = testRunner ;
3007+ testRunner . contentWindow . document . open ( ) ;
3008+ testRunner . contentWindow . document . write ( testRunner . parentNode . querySelector ( ".qunit-code" ) . innerText ) ;
3009+ testRunner . contentWindow . document . close ( ) ;
3010+ } ) ;
3011+ } ) ;
3012+ } ,
3013+ "resetTests" : function ( el ) {
3014+ return new Promise ( function ( resolve , reject ) {
3015+ var newRunner = el . cloneNode ( false ) ;
3016+ newRunner . addEventListener ( "load" , function ( ) {
3017+ resolve ( newRunner ) ;
3018+ } ) ;
3019+ el . parentNode . insertBefore ( newRunner , el ) ;
3020+ el . remove ( ) ;
30073021 } ) ;
30083022 } ,
30093023 "codeMirrorInit" : function ( ) {
You can’t perform that action at this time.
0 commit comments