@@ -15,7 +15,7 @@ const loader = require('../');
15
15
16
16
describe ( 'loader' , function ( ) {
17
17
18
- function testLoader ( fileName , callback , query ) {
18
+ function testLoader ( fileName , callback , query , version = 2 ) {
19
19
20
20
return function ( ) {
21
21
@@ -29,6 +29,7 @@ describe('loader', function() {
29
29
cacheable : cacheableSpy ,
30
30
callback : callbackSpy ,
31
31
resourcePath : fileName ,
32
+ version,
32
33
query,
33
34
} , fileContents , null ) ;
34
35
@@ -164,6 +165,28 @@ describe('loader', function() {
164
165
165
166
} ) ;
166
167
168
+ describe ( 'shared' , function ( ) {
169
+
170
+ it ( 'should configure shared=false (default)' ,
171
+ testLoader ( 'test/fixtures/good.html' , function ( err , code , map ) {
172
+ expect ( err ) . not . to . exist ;
173
+
174
+ expect ( code ) . not . to . contain ( 'import {' ) ;
175
+ expect ( code ) . not . to . contain ( 'svelte/shared.js' ) ;
176
+ } , { } , 1 )
177
+ ) ;
178
+
179
+
180
+ it ( 'should configure shared=true' ,
181
+ testLoader ( 'test/fixtures/good.html' , function ( err , code , map ) {
182
+ expect ( err ) . not . to . exist ;
183
+
184
+ expect ( code ) . to . contain ( 'import {' ) ;
185
+ expect ( code ) . to . contain ( 'svelte/shared.js' ) ;
186
+ } , { shared : true } )
187
+ ) ;
188
+
189
+ } ) ;
167
190
168
191
describe ( 'generate' , function ( ) {
169
192
0 commit comments