diff --git a/test/formats/index.js b/test/formats/index.js
index 8028a7e4ab..dee4f2c1be 100644
--- a/test/formats/index.js
+++ b/test/formats/index.js
@@ -165,6 +165,43 @@ describe("formats", () => {
});
}, /Missing required 'name' option for IIFE export/);
});
+
+ it('suggests using options.globals for default imports', () => {
+ const warnings = [];
+
+ svelte.compile(`
+
+ `,
+ {
+ format: 'iife',
+ name: 'App',
+ onwarn: warning => {
+ warnings.push(warning);
+ }
+ }
+ );
+
+ assert.deepEqual(warnings, [{
+ message: `No name was supplied for imported module 'lodash'. Guessing '_', but you should use options.globals`
+ }]);
+ });
+
+ it('insists on options.globals for named imports', () => {
+ assert.throws(() => {
+ svelte.compile(`
+
+ `,
+ {
+ format: 'iife',
+ name: 'App'
+ }
+ );
+ }, /Could not determine name for imported module 'svelte-transitions' – use options.globals/);
+ });
});
describe("umd", () => {