0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

[ci] npm run format

This commit is contained in:
matthewp 2021-04-19 18:41:37 +00:00 committed by GitHub Actions
parent eb984559a8
commit 46a6ba6093
2 changed files with 16 additions and 22 deletions

View file

@ -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,

View file

@ -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');
});