diff --git a/packages/astro/test/astro-children.test.js b/packages/astro/test/astro-children.test.js index 68eef1d7a..6cac50407 100644 --- a/packages/astro/test/astro-children.test.js +++ b/packages/astro/test/astro-children.test.js @@ -85,7 +85,7 @@ describe('Component children', () => { ); // test 3: If client, and children are rendered, no template is. - expect($('#client-render').parent().children()).to.have.lengthOf(1); + expect($('#client-render').parent().children()).to.have.lengthOf(2); expect($('#client-render').parent().find('template')).to.have.lengthOf(0); // test 4: If client and no children are provided, no template is. diff --git a/packages/astro/test/astro-slots-nested.test.js b/packages/astro/test/astro-slots-nested.test.js index 17dcd65de..518a7e693 100644 --- a/packages/astro/test/astro-slots-nested.test.js +++ b/packages/astro/test/astro-slots-nested.test.js @@ -15,7 +15,8 @@ describe('Nested Slots', () => { const html = await fixture.readFile('/hidden-nested/index.html'); const $ = cheerio.load(html); expect($('script')).to.have.a.lengthOf(3, 'script rendered'); - const scriptInTemplate = $($('template')[0].children[0]).find('script'); + // Astro Island scripts are [async], so this will only find other types of scripts + const scriptInTemplate = $($('template')[0].children[0]).find('script:not([async])'); expect(scriptInTemplate).to.have.a.lengthOf(0, 'script defined outside of the inner template'); }); diff --git a/packages/astro/test/hydration-race.test.js b/packages/astro/test/hydration-race.test.js index d35681557..21fad92f5 100644 --- a/packages/astro/test/hydration-race.test.js +++ b/packages/astro/test/hydration-race.test.js @@ -24,6 +24,6 @@ describe('Hydration script ordering', async () => { // Sanity check that we're only rendering them once. expect($('style')).to.have.a.lengthOf(1, 'hydration style added once'); - expect($('script')).to.have.a.lengthOf(1, 'only one hydration script needed'); + expect($('script')).to.have.a.lengthOf(4, 'only one hydration script needed'); }); }); diff --git a/packages/astro/test/test-utils.js b/packages/astro/test/test-utils.js index 6ec3d83dc..67c72a944 100644 --- a/packages/astro/test/test-utils.js +++ b/packages/astro/test/test-utils.js @@ -253,6 +253,7 @@ export function getIslandDataFromScript(text) { const args = { Astro, document } // Yes, I know, `eval` is bad! But our data is embedded as JS on purpose. + // eslint-disable-next-line @typescript-eslint/no-implied-eval return new Function(Object.keys(args), `return ${text}`)(...Object.values(args)); }