(url, context, defaultLoad)
| 85 | } |
| 86 | |
| 87 | export async function load(url, context, defaultLoad) { |
| 88 | doDrainPort(); |
| 89 | /** |
| 90 | * Mocked fake module, not going to be handled in default way so it |
| 91 | * generates the source text, then short circuits |
| 92 | */ |
| 93 | if (url.startsWith('mock-facade:')) { |
| 94 | const encodedTargetURL = url.slice(url.lastIndexOf(':') + 1); |
| 95 | return { |
| 96 | shortCircuit: true, |
| 97 | source: generateModule(encodedTargetURL), |
| 98 | format: 'module', |
| 99 | }; |
| 100 | } |
| 101 | return defaultLoad(url, context); |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Generate the source code for a mocked module. |
nothing calls this directly
no test coverage detected