@@ -61,6 +61,10 @@ for (const { protocol, createServer } of [
61
61
const host = new URL ( base ) ;
62
62
host . protocol = protocol ;
63
63
host . hostname = hostname ;
64
+ // /not-found is a 404
65
+ // ?redirect causes a redirect, no body. JSON.parse({status:number,location:string})
66
+ // ?mime sets the content-type, string
67
+ // ?body sets the body, string
64
68
const server = createServer ( function ( _req , res ) {
65
69
const url = new URL ( _req . url , host ) ;
66
70
const redirect = url . searchParams . get ( 'redirect' ) ;
@@ -128,6 +132,14 @@ for (const { protocol, createServer } of [
128
132
assert . strict . equal ( depsNS . data , 1 ) ;
129
133
assert . strict . equal ( depsNS . http , ns ) ;
130
134
135
+ const relativeDeps = new URL ( url . href ) ;
136
+ relativeDeps . searchParams . set ( 'body' , `
137
+ import * as http from "./";
138
+ export {http};
139
+ ` ) ;
140
+ const relativeDepsNS = await import ( relativeDeps . href ) ;
141
+ assert . strict . deepStrictEqual ( Object . keys ( relativeDepsNS ) , [ 'http' ] ) ;
142
+ assert . strict . equal ( relativeDepsNS . http , ns ) ;
131
143
const fileDep = new URL ( url . href ) ;
132
144
const { href } = pathToFileURL ( path ( '/es-modules/message.mjs' ) ) ;
133
145
fileDep . searchParams . set ( 'body' , `
0 commit comments