diff --git a/packages/astro/src/compiler/codegen/index.ts b/packages/astro/src/compiler/codegen/index.ts index 9271ab50a..fa00e8c99 100644 --- a/packages/astro/src/compiler/codegen/index.ts +++ b/packages/astro/src/compiler/codegen/index.ts @@ -422,7 +422,7 @@ function dedent(str: string) { return !arr || !first ? str : str.replace(new RegExp(`^[ \\t]{0,${first}}`, 'gm'), ''); } -const FALSY_EXPRESSIONS = new Set(['false','null','undefined','void 0']); +const FALSY_EXPRESSIONS = new Set(['false', 'null', 'undefined', 'void 0']); /** Compile page markup */ async function compileHtml(enterNode: TemplateNode, state: CodegenState, compileOptions: CompileOptions): Promise { diff --git a/packages/astro/test/astro-expr.test.js b/packages/astro/test/astro-expr.test.js index 04a005aae..485d58d9b 100644 --- a/packages/astro/test/astro-expr.test.js +++ b/packages/astro/test/astro-expr.test.js @@ -61,9 +61,9 @@ Expressions('Allows multiple JSX children in mustache', async ({ runtime }) => { Expressions('Does not render falsy values using &&', async ({ runtime }) => { const result = await runtime.load('/falsy'); if (result.error) throw new Error(result.error); - + const $ = doc(result.contents); - + assert.equal($('#true').length, 1, `Expected {true && } to render`); assert.equal($('#zero').text(), '0', `Expected {0 && "VALUE"} to render "0"`); assert.equal($('#false').length, 0, `Expected {false && } not to render`);