send the test files with the correct content-type header
parent
951c93fa6d
commit
ca405c1685
|
@ -17,7 +17,7 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
||||||
files = files.filter((f) => f.endsWith('.js'));
|
files = files.filter((f) => f.endsWith('.js'));
|
||||||
|
|
||||||
console.debug('Sent browser the following test specs:', files);
|
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`);
|
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} });`;
|
content = `describe(${JSON.stringify(specFileName)}, function(){ ${content} });`;
|
||||||
|
|
||||||
|
if(!specFilePath.endsWith('index.html')) res.setHeader('content-type', 'application/javascript');
|
||||||
|
|
||||||
res.send(content);
|
res.send(content);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue