@@ -56,7 +56,8 @@ export class Sample {
5656
5757 constructor (
5858 dir : string ,
59- readonly name : string
59+ readonly name : string ,
60+ public emitOnTemplateError = false
6061 ) {
6162 this . directory = path . resolve ( dir , 'samples' , name ) ;
6263 this . folder = fs . readdirSync ( this . directory ) ;
@@ -110,7 +111,7 @@ export class Sample {
110111
111112 const sample = this ;
112113
113- _it ( this . name , function ( ) {
114+ _it ( this . name + ( this . emitOnTemplateError ? ' (loose parser mode)' : '' ) , function ( ) {
114115 try {
115116 fn ( ) ;
116117 if ( sample . skipped ) this . skip ( ) ;
@@ -237,7 +238,7 @@ export function test_samples(dir: string, transform: TransformSampleFn, js: 'js'
237238 const config = {
238239 filename : svelteFile ,
239240 sampleName : sample . name ,
240- emitOnTemplateError : false ,
241+ emitOnTemplateError : sample . emitOnTemplateError ,
241242 preserveAttributeCase : sample . name . endsWith ( '-foreign-ns' )
242243 } ;
243244
@@ -382,6 +383,9 @@ export function get_svelte2tsx_config(base: BaseConfig, sampleName: string): Sve
382383export function * each_sample ( dir : string ) {
383384 for ( const name of fs . readdirSync ( `${ dir } /samples` ) ) {
384385 yield new Sample ( dir , name ) ;
386+ if ( isSvelte5Plus && ! fs . existsSync ( `${ dir } /samples/${ name } /expected.error.json` ) ) {
387+ yield new Sample ( dir , `${ name } ` , true ) ;
388+ }
385389 }
386390}
387391
0 commit comments