MIRROR: javascript for 馃悳's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at master 22 lines 704 B view raw
1function assert(condition, message) { 2 if (!condition) throw new Error(message); 3} 4 5const expectedPath = import.meta.dirname + '/missing_named_export_target.mjs'; 6const expectedMessage = 7 `The requested module '${expectedPath}' does not provide an export named 'createDebug'`; 8 9let caught = null; 10 11try { 12 await import('./missing_named_export_importer.mjs'); 13} catch (err) { 14 caught = err; 15} 16 17assert(caught, 'expected import to fail'); 18assert(caught.name === 'SyntaxError', `expected SyntaxError, got ${caught && caught.name}`); 19assert(caught.message === expectedMessage, 20 `unexpected message:\n${caught && caught.message}\n!=\n${expectedMessage}`); 21 22console.log('missing named export test passed');