Amend shapeshifter to allow use of dynamic import
This commit is contained in:
parent
688a3d29fd
commit
130fb9c217
2 changed files with 20 additions and 2 deletions
|
|
@ -11,4 +11,10 @@ describe('shapeshifter', () => {
|
|||
it('Should shift simple double quote string', () => {
|
||||
assert.equal(shapeshifter('"c3"'), '(async()=>{return mini("c3").withMiniLocation([1,0,15],[1,4,19])})()');
|
||||
});
|
||||
it('Should handle dynamic imports', () => {
|
||||
assert.equal(
|
||||
shapeshifter('const { default: foo } = await import(\'https://bar.com/foo.js\');"c3"'),
|
||||
'(async()=>{const{default:foo}=await import("https://bar.com/foo.js");return mini("c3").withMiniLocation([1,64,79],[1,68,83])})()',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue