diff --git a/src/node/hooks/express/tests.js b/src/node/hooks/express/tests.js index 7b32a322d..87edc2a09 100644 --- a/src/node/hooks/express/tests.js +++ b/src/node/hooks/express/tests.js @@ -17,7 +17,7 @@ exports.expressCreateServer = function (hook_name, args, cb) { files = files.filter((f) => f.endsWith('.js')); console.debug('Sent browser the following test specs:', files); - res.setHeader('content-type', 'text/javascript'); + res.setHeader('content-type', 'application/javascript'); res.end(`var specs_list = ${JSON.stringify(files)};\n`); }); @@ -49,6 +49,8 @@ exports.expressCreateServer = function (hook_name, args, cb) { content = `describe(${JSON.stringify(specFileName)}, function(){ ${content} });`; + if(!specFilePath.endsWith('index.html')) res.setHeader('content-type', 'application/javascript'); + res.send(content); }); });