Skip to content

Commit 2381311

Browse files
committed
fix(server): allow loading qunit from node modules
1 parent 00e4a44 commit 2381311

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

createTestServer.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ export async function createTestServer( {
9898
res.writeHead( 200, { "Content-Type": "text/html" } );
9999
res.end(
100100
indexHTML.replace(
101-
"</head>",
102-
"<script src=\"/node_modules/jquery-test-runner/listeners.js\"></script></head>"
101+
"</body>",
102+
"<script src=\"/node_modules/jquery-test-runner/listeners.js\"></script></body>"
103103
)
104104
);
105105
} else {
@@ -161,10 +161,12 @@ export async function createTestServer( {
161161
};
162162
use( async( req, res, next ) => {
163163

164-
// Allow serving anything but node_modules, except for jquery-test-runner
164+
// Allow serving anything but node_modules,
165+
// except for jquery-test-runner and qunit
165166
if (
166167
req.url.startsWith( "/node_modules/" ) &&
167-
!req.url.startsWith( "/node_modules/jquery-test-runner/" )
168+
!req.url.startsWith( "/node_modules/jquery-test-runner/" ) &&
169+
!req.url.startsWith( "/node_modules/qunit/" )
168170
) {
169171
return next();
170172
}

0 commit comments

Comments
 (0)