summaryrefslogtreecommitdiff
path: root/packages/astro/test/astro-scripts.test.js
diff options
context:
space:
mode:
authorGravatar Nate Moore <natemoo-re@users.noreply.github.com> 2022-03-09 15:44:26 -0600
committerGravatar GitHub <noreply@github.com> 2022-03-09 15:44:26 -0600
commit72c2c86e9d7c9b2ce6be13ddb273d4b0b11a5723 (patch)
tree70e95cd5fcebf5e4ea532946a370cca4c7d3a221 /packages/astro/test/astro-scripts.test.js
parentc139829b1013c0c1b1d0a20d471d77769b3c91f1 (diff)
downloadastro-72c2c86e9d7c9b2ce6be13ddb273d4b0b11a5723.tar.gz
astro-72c2c86e9d7c9b2ce6be13ddb273d4b0b11a5723.tar.zst
astro-72c2c86e9d7c9b2ce6be13ddb273d4b0b11a5723.zip
merge `next` into `main` (#2705)
* Unflag the static build (#2652) * Unflag the static build * Only set legacyBuild to false if experimentalSSR is true * Use legacy build when we have to * Put a few more tests into legacy mode * Last two * Make astro-basic use the legacy build * Adds a changeset * Mark the lit test as legacy * Update yarn lock * Update based on feedback * Add --legacy-build flag * Move astro-basic test to use static build (#2682) * Move some tests over to the static build (#2677) * Move some tests over to the static build * Fix assets tests * Fix the assets tests * Fix for the client:only components * Moves asset tests to the static build * Move postcss test over to static build * Bring back legacy build for astro-basic test * Move astro-basic test to use static build * Migrate more tests to the static build (#2693) * fix: disable HMR during build (#2684) * Migrate more tests to the static build * Only prepend links in non-legacy mode * Add the 0-css tests * Convert all CSS tests to the static build * Migrate Astro global tests * Remove .only * Fix static build tests * Migrate a few more * More tests * Move the lit test back to legacy * Increase the test timeout Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com> * Improve `head` injection behavior (#2436) * feat: add renderHead util to server * feat: remove `layouts` from config, Vite plugin * fix: improve head injection during rendering * chore: update compiler * fix: do not escape links * chore: enter `pre` mode * Replace `send` with `sirv` (#2713) * remove send * Create thick-ravens-chew.md * I feel like I'm going to screw something up * working finally! * rewrite req.url * Add tiny bit of doc * Update .gitignore Co-authored-by: Evan Boehs <evan@boehs.org> * Move remaining tests to the static build (#2712) * Move lit test to the static build * Migrate astro-env plugin to work in the static build * Do not remove vite:define * Adds a changeset * Add a warning when passing the --experimental-static-build flag (#2718) * Add a warning when passing the --experimental-static-build flag * Disable the lint warning * [ci] release (next) (#2721) * [ci] release (next) * chore: update changeset Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Nate Moore <nate@skypack.dev> * 404 page (#2719) * Fix: build to 404.html in the static build * Adds a changeset * fix pnpm install missing peer deps * fix svelte version in workspace * fix lockfile * fix(webapi): add dev script * improve preview reliability (#2739) * improve preview reliability - fix broken tests * shamefully hoist to unblock * remove lit from test running * chore: update lockfile Co-authored-by: Matthew Phillips <matthew@skypack.dev> Co-authored-by: Evan Boehs <evan@boehs.org> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Fred K. Schott <fkschott@gmail.com>
Diffstat (limited to 'packages/astro/test/astro-scripts.test.js')
-rw-r--r--packages/astro/test/astro-scripts.test.js15
1 files changed, 11 insertions, 4 deletions
diff --git a/packages/astro/test/astro-scripts.test.js b/packages/astro/test/astro-scripts.test.js
index 3a16969ea..cd54ea768 100644
--- a/packages/astro/test/astro-scripts.test.js
+++ b/packages/astro/test/astro-scripts.test.js
@@ -7,7 +7,14 @@ describe('Scripts (hoisted and not)', () => {
let fixture;
before(async () => {
- fixture = await loadFixture({ projectRoot: './fixtures/astro-scripts/' });
+ fixture = await loadFixture({
+ projectRoot: './fixtures/astro-scripts/',
+ vite: {
+ build: {
+ assetsInlineLimit: 0
+ }
+ }
+ });
await fixture.build();
});
@@ -38,8 +45,8 @@ describe('Scripts (hoisted and not)', () => {
// test 2: attr removed
expect($('script').attr('data-astro')).to.equal(undefined);
- let entryURL = path.join('inline', $('script').attr('src'));
- let inlineEntryJS = await fixture.readFile(entryURL);
+ const entryURL = $('script').attr('src');
+ const inlineEntryJS = await fixture.readFile(entryURL);
// test 3: the JS exists
expect(inlineEntryJS).to.be.ok;
@@ -53,7 +60,7 @@ describe('Scripts (hoisted and not)', () => {
expect($('script')).to.have.lengthOf(2);
let el = $('script').get(1);
- let entryURL = path.join('external', $(el).attr('src'));
+ let entryURL = $(el).attr('src');
let externalEntryJS = await fixture.readFile(entryURL);
// test 2: the JS exists