From 21b82333255a2a0e3c66ab5ea860e584578d0a00 Mon Sep 17 00:00:00 2001 From: Shahriyar Nasir Date: Sun, 7 Jun 2020 16:04:30 -0400 Subject: [PATCH] Patch karma to allow loading virtual packages --- lib/middleware/karma.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/middleware/karma.js b/lib/middleware/karma.js index c48332d12..72e1735a1 100644 --- a/lib/middleware/karma.js +++ b/lib/middleware/karma.js @@ -220,11 +220,11 @@ function createKarmaMiddleware ( }) : [] return data - .replace('%SCRIPTS%', scriptTags.join('\n')) - .replace('%CLIENT_CONFIG%', 'window.__karma__.config = ' + JSON.stringify(client) + ';\n') - .replace('%SCRIPT_URL_ARRAY%', 'window.__karma__.scriptUrls = ' + JSON.stringify(scriptUrls) + ';\n') - .replace('%MAPPINGS%', 'window.__karma__.files = {\n' + mappings.join(',\n') + '\n};\n') - .replace('\n%X_UA_COMPATIBLE%', getXUACompatibleMetaElement(request.url)) + .replace('%SCRIPTS%', () => scriptTags.join('\n')) + .replace('%CLIENT_CONFIG%', () => 'window.__karma__.config = ' + JSON.stringify(client) + ';\n') + .replace('%SCRIPT_URL_ARRAY%', () => 'window.__karma__.scriptUrls = ' + JSON.stringify(scriptUrls) + ';\n') + .replace('%MAPPINGS%', () => 'window.__karma__.files = {\n' + mappings.join(',\n') + '\n};\n') + .replace('\n%X_UA_COMPATIBLE%', () => getXUACompatibleMetaElement(request.url)) }) }) } else if (requestUrl === '/context.json') {