summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/runtime.ts32
-rw-r--r--test/astro-dynamic.test.js6
2 files changed, 16 insertions, 22 deletions
diff --git a/src/runtime.ts b/src/runtime.ts
index 40fa1dce2..c66f3f114 100644
--- a/src/runtime.ts
+++ b/src/runtime.ts
@@ -302,26 +302,20 @@ async function createSnowpack(astroConfig: AstroConfig, options: CreateSnowpackO
export async function createRuntime(astroConfig: AstroConfig, { mode, logging }: RuntimeOptions): Promise<AstroRuntime> {
const resolvePackageUrl = async (pkgName: string) => frontendSnowpack.getUrlForPackage(pkgName);
- const { snowpack: backendSnowpack, snowpackRuntime: backendSnowpackRuntime, snowpackConfig: backendSnowpackConfig } = await createSnowpack(
- astroConfig,
- {
- env: {
- astro: true
- },
- mode,
- resolvePackageUrl
- }
- );
+ const { snowpack: backendSnowpack, snowpackRuntime: backendSnowpackRuntime, snowpackConfig: backendSnowpackConfig } = await createSnowpack(astroConfig, {
+ env: {
+ astro: true,
+ },
+ mode,
+ resolvePackageUrl,
+ });
- const { snowpack: frontendSnowpack, snowpackRuntime: frontendSnowpackRuntime, snowpackConfig: frontendSnowpackConfig } = await createSnowpack(
- astroConfig,
- {
- env: {
- astro: false
- },
- mode
- }
- );
+ const { snowpack: frontendSnowpack, snowpackRuntime: frontendSnowpackRuntime, snowpackConfig: frontendSnowpackConfig } = await createSnowpack(astroConfig, {
+ env: {
+ astro: false,
+ },
+ mode,
+ });
const runtimeConfig: RuntimeConfig = {
astroConfig,
diff --git a/test/astro-dynamic.test.js b/test/astro-dynamic.test.js
index 41235b6ce..0dcc30654 100644
--- a/test/astro-dynamic.test.js
+++ b/test/astro-dynamic.test.js
@@ -15,14 +15,14 @@ DynamicComponents('Loads client-only packages', async ({ runtime }) => {
// Grab the react-dom import
const exp = /import\("(.+?)"\)/g;
let match, reactDomURL;
- while(match = exp.exec(result.contents)) {
- if(match[1].includes('react-dom')) {
+ while ((match = exp.exec(result.contents))) {
+ if (match[1].includes('react-dom')) {
reactDomURL = match[1];
}
}
assert.ok(reactDomURL, 'React dom is on the page');
-
+
result = await runtime.load(reactDomURL);
assert.equal(result.statusCode, 200, 'Can load react-dom');
});