Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
add test for #9
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Sep 19, 2016
1 parent 9040175 commit 5e98552
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/samples/import-namespace/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
console.log( foo.bar );
console.log( foo.baz );
15 changes: 15 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,19 @@ describe( 'rollup-plugin-inject', function () {
assert.deepEqual( bundle.imports, [ 'is-buffer' ]);
});
});

it( 'generates * imports', function () {
return rollup.rollup({
entry: 'samples/import-namespace/main.js',
plugins: [
inject({ foo: [ 'foo', '*' ] })
],
external: [ 'foo' ]
}).then( function ( bundle ) {
var generated = bundle.generate();
var code = generated.code;

assert.ok( code.indexOf( "import * as foo from 'foo'" ) !== -1, generated.code );
});
});
});

0 comments on commit 5e98552

Please sign in to comment.