File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/app/src/sandbox/eval/tests Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -45,10 +45,15 @@ function addScript(src: string) {
4545 } ) ;
4646}
4747
48+ let jsdomPromise = null ;
4849/**
4950 * Load JSDOM while the sandbox loads. Before we run a test we make sure that this has been loaded.
5051 */
51- const jsdomPromise = addScript ( '/static/js/jsdom-4.0.0.min.js' ) ;
52+ const getJSDOM = ( ) => {
53+ jsdomPromise = jsdomPromise || addScript ( '/static/js/jsdom-4.0.0.min.js' ) ;
54+
55+ return jsdomPromise ;
56+ } ;
5257
5358function resetTestState ( ) {
5459 const ROOT_DESCRIBE_BLOCK = makeDescribe ( ROOT_DESCRIBE_BLOCK_NAME ) ;
@@ -220,7 +225,7 @@ export default class TestRunner {
220225 return ;
221226 }
222227
223- await jsdomPromise ;
228+ await getJSDOM ( ) ;
224229
225230 this . sendMessage ( 'total_test_start' ) ;
226231
You can’t perform that action at this time.
0 commit comments