shift the registry code down close to the require call

pull/4251/head
tanhauhau 4 years ago
parent 130aab9621
commit 19eb2cc8b1

@ -57,20 +57,13 @@ describe('runtime', () => {
unhandled_rejection = null;
const cwd = path.resolve(`${__dirname}/samples/${dir}`);
const compileOptions = {
...config.compileOptions,
hydratable: hydrate,
immutable: config.immutable,
accessors: 'accessors' in config ? config.accessors : true
};
register.clearCompileOutputCache();
register.clearRequireCache();
register.setCompile((config.preserveIdentifiers ? svelte : svelte$).compile);
register.setCompileOptions(compileOptions);
register.setOutputFolderName(hydrate ? 'hydratable' : 'normal');
let mod;
let SvelteComponent;
@ -99,7 +92,13 @@ describe('runtime', () => {
flush();
};
});
register.clearCompileOutputCache();
register.clearRequireCache();
register.setCompile((config.preserveIdentifiers ? svelte : svelte$).compile);
register.setCompileOptions(compileOptions);
register.setOutputFolderName(hydrate ? 'hydratable' : 'normal');
mod = require(`./samples/${dir}/main.svelte`);
SvelteComponent = mod.default;

Loading…
Cancel
Save