Skip to content

Commit

Permalink
fix css lookup until a middleware implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Apr 22, 2021
1 parent d4d53bc commit d66a7e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/commands/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export default async function(config) {
config.COUNTER = { testCount: 0, failCount: 0, skipCount: 0, passCount: 0 };

if (config.browser) {
// TODO: make static css/js middleware and output all needed files to config.outputFolder

let [QUnitCSS, ...htmlBuffers] = await Promise.all([
fs.readFile(`${process.cwd()}/node_modules/qunit/qunit/qunit.css`),
].concat(config.htmlPaths.map((htmlPath) => fs.readFile(`${projectRoot}/${htmlPath}`)))); // TODO: remove this and read it from the fsTree, should be cached?
Expand Down
2 changes: 1 addition & 1 deletion lib/setup/web-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default async function setupWebServer(config = {
setupQUnit();
</script>`;

if (req.url === '../node_modules/qunit/qunit/qunit.css') {
if (['../node_modules/qunit/qunit/qunit.css', './node_modules/qunit/qunit/qunit.css', '/node_modules/qunit/qunit/qunit.css'].includes(req.url)) {
res.writeHead(200, { 'Content-Type': 'text/css' });
return res.end(cachedContent.QUnitCSS, 'utf-8');
}
Expand Down

0 comments on commit d66a7e2

Please sign in to comment.