From 19eb2cc8b14f0103e15997c62a2ff0f4ed07e686 Mon Sep 17 00:00:00 2001 From: tanhauhau Date: Fri, 14 Oct 2022 22:30:18 +0800 Subject: [PATCH] shift the registry code down close to the require call --- test/runtime/index.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/test/runtime/index.ts b/test/runtime/index.ts index 127f9b23d3..7dd83be2e3 100644 --- a/test/runtime/index.ts +++ b/test/runtime/index.ts @@ -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;