diff options
author | 2022-09-14 13:51:38 -0400 | |
---|---|---|
committer | 2022-09-14 13:51:38 -0400 | |
commit | f1efd88ddefe078f64901b1754ebfbaf65d36b51 (patch) | |
tree | 18647fb401a9516ff378ddd230e58cc6b57b4fba /packages/astro/test/astro-scripts.test.js | |
parent | 1bedb9427ebbe92eb74a82fc70cb67a97a250f32 (diff) | |
download | astro-f1efd88ddefe078f64901b1754ebfbaf65d36b51.tar.gz astro-f1efd88ddefe078f64901b1754ebfbaf65d36b51.tar.zst astro-f1efd88ddefe078f64901b1754ebfbaf65d36b51.zip |
Compatiblity between hoisted scripts and tailwind integration (#4755)
* Compatiblity between hoisted scripts and tailwind integration
* Adds a changeset
Diffstat (limited to '')
-rw-r--r-- | packages/astro/test/astro-scripts.test.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/packages/astro/test/astro-scripts.test.js b/packages/astro/test/astro-scripts.test.js index 1229de5f5..4eaa29a6a 100644 --- a/packages/astro/test/astro-scripts.test.js +++ b/packages/astro/test/astro-scripts.test.js @@ -119,7 +119,8 @@ describe('Scripts (hoisted and not)', () => { let html = await fixture.readFile('/with-styles/index.html'); let $ = cheerio.load(html); - expect($('link[rel=stylesheet]')).to.have.a.lengthOf(1); + // Imported styles + tailwind + expect($('link[rel=stylesheet]')).to.have.a.lengthOf(2); }); }); @@ -150,5 +151,21 @@ describe('Scripts (hoisted and not)', () => { }); expect(found).to.equal(1); }); + + it('Using injectScript does not interfere', async () => { + let res = await fixture.fetch('/inline-in-page'); + let html = await res.text(); + let $ = cheerio.load(html); + let found = 0; + let moduleScripts = $('[type=module]'); + moduleScripts.each((i, el) => { + if ( + $(el).attr('src').includes('?astro&type=script&index=0&lang.ts') + ) { + found++; + } + }); + expect(found).to.equal(1); + }); }); }); |