@@ -71,32 +71,7 @@ describe('loader', () => {
71
71
expect ( err . message ) . to . eql ( d `
72
72
ParseError: Unexpected block closing tag (1:23)
73
73
1: <p>Count: {count}</p>{/if}
74
- ^
75
- 2: <button on:click='set({ count: count + 1 })'>+1</button>` ) ;
76
-
77
- expect ( code ) . not . to . exist ;
78
- expect ( map ) . not . to . exist ;
79
- } )
80
- ) ;
81
-
82
- it (
83
- 'should handle wrong export' ,
84
- testLoader ( 'test/fixtures/export-error.html' , function (
85
- err ,
86
- code ,
87
- map ,
88
- context
89
- ) {
90
- expect ( err ) . to . exist ;
91
-
92
- expect ( err . message ) . to . eql ( d `
93
- ParseError: Unexpected token (5:7)
94
- 3: <script>
95
- 4: export {
96
- 5: foo: 'BAR'
97
- ^
98
- 6: };
99
- 7: </script>` ) ;
74
+ ^` ) ;
100
75
101
76
expect ( code ) . not . to . exist ;
102
77
expect ( map ) . not . to . exist ;
@@ -113,14 +88,13 @@ describe('loader', () => {
113
88
) {
114
89
expect ( err ) . to . exist ;
115
90
116
- expect ( err . message ) . to . eql ( d `
117
- ValidationError: Computed properties can be function expressions or arrow function expressions (6:11)
118
- 4: export default {
119
- 5: computed: {
120
- 6: foo: 'BAR'
121
- ^
122
- 7: }
123
- 8: };` ) ;
91
+ expect ( err . message . trim ( ) ) . to . eql ( d `
92
+ ValidationError: A component cannot have a default export (2:1)
93
+ 1: <script>
94
+ 2: export default {};
95
+ ^
96
+ 3: </script>
97
+ 4:` ) ;
124
98
125
99
expect ( code ) . not . to . exist ;
126
100
expect ( map ) . not . to . exist ;
@@ -138,8 +112,7 @@ describe('loader', () => {
138
112
expect ( map ) . to . exist ;
139
113
140
114
// es2015 statements remain
141
- expect ( code ) . to . contain ( `import { hello } from './utils';` ) ;
142
- expect ( code ) . to . contain ( 'data() {' ) ;
115
+ expect ( code ) . to . contain ( `import { hello } from "./utils";` ) ;
143
116
} )
144
117
) ;
145
118
@@ -149,7 +122,7 @@ describe('loader', () => {
149
122
expect ( err ) . not . to . exist ;
150
123
151
124
// es2015 statements remain
152
- expect ( code ) . to . contain ( `import Nested from ' ./nested' ;` ) ;
125
+ expect ( code ) . to . contain ( `import Nested from " ./nested" ;` ) ;
153
126
154
127
expect ( code ) . to . exist ;
155
128
expect ( map ) . to . exist ;
@@ -180,33 +153,18 @@ describe('loader', () => {
180
153
) ;
181
154
} ) ;
182
155
183
- describe ( 'shared' , ( ) => {
184
- it (
185
- 'should configure shared=false (default)' ,
186
- testLoader (
187
- 'test/fixtures/good.html' ,
188
- function ( err , code , map ) {
189
- expect ( err ) . not . to . exist ;
190
-
191
- expect ( code ) . not . to . contain ( 'import {' ) ;
192
- expect ( code ) . not . to . contain ( 'svelte/shared.js' ) ;
193
- } ,
194
- { shared : false } ,
195
- 1
196
- )
197
- ) ;
198
-
156
+ describe ( 'sveltePath' , ( ) => {
199
157
it (
200
- 'should configure shared=true ' ,
158
+ 'should configure sveltePath ' ,
201
159
testLoader (
202
160
'test/fixtures/good.html' ,
203
161
function ( err , code , map ) {
204
162
expect ( err ) . not . to . exist ;
205
163
206
164
expect ( code ) . to . contain ( 'import {' ) ;
207
- expect ( code ) . to . contain ( 'svelte/shared.js ' ) ;
165
+ expect ( code ) . to . contain ( 'custom- svelte/internal ' ) ;
208
166
} ,
209
- { shared : true }
167
+ { sveltePath : 'custom-svelte' }
210
168
)
211
169
) ;
212
170
} ) ;
@@ -230,9 +188,7 @@ describe('loader', () => {
230
188
function ( err , code , map ) {
231
189
expect ( err ) . not . to . exist ;
232
190
233
- expect ( code ) . to . contain (
234
- '.render = function(state, options = {}) {'
235
- ) ;
191
+ expect ( code ) . to . contain ( 'create_ssr_component' ) ;
236
192
} ,
237
193
{ generate : 'ssr' }
238
194
)
0 commit comments