File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed
samples/component-not-constructor2
runtime-runes/samples/bind-this-proxy Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { test } from '../../test' ;
2
2
3
3
export default test ( {
4
+ compileOptions : {
5
+ // override process.env.HMR — this test only passes in prod mode because in dev mode we generate a helpful error
6
+ dev : false
7
+ } ,
8
+
4
9
get props ( ) {
5
10
return { componentName : 'Sub' } ;
6
11
} ,
Original file line number Diff line number Diff line change @@ -138,11 +138,13 @@ export function runtime_suite(runes: boolean) {
138
138
}
139
139
140
140
async function common_setup ( cwd : string , runes : boolean | undefined , config : RuntimeTest ) {
141
+ const force_hmr = process . env . HMR && config . compileOptions ?. dev !== false && ! config . error ;
142
+
141
143
const compileOptions : CompileOptions = {
142
144
generate : 'client' ,
143
145
rootDir : cwd ,
144
- dev : process . env . HMR ? true : undefined ,
145
- hmr : process . env . HMR ? true : undefined ,
146
+ dev : force_hmr ? true : undefined ,
147
+ hmr : force_hmr ? true : undefined ,
146
148
...config . compileOptions ,
147
149
immutable : config . immutable ,
148
150
accessors : 'accessors' in config ? config . accessors : true ,
Original file line number Diff line number Diff line change @@ -2,6 +2,11 @@ import { flushSync } from 'svelte';
2
2
import { test } from '../../test' ;
3
3
4
4
export default test ( {
5
+ compileOptions : {
6
+ // override process.env.HMR — this test only passes in prod mode, because in dev we add `$destroy` methods etc
7
+ dev : false
8
+ } ,
9
+
5
10
html : `<button>Toggle</button><div>Hello\nworld</div>` ,
6
11
7
12
async test ( { assert, target, logs } ) {
You can’t perform that action at this time.
0 commit comments