Skip to content

Commit

Permalink
fix: upgrade Vite and update tests (#13011)
Browse files Browse the repository at this point in the history
* fix: upgrade Vite and update tests

* chore: remove cors header snapshot

* chore: upgrade Vitest

* chore: revert edit

* chore: changeset
  • Loading branch information
ascorbic authored Jan 20, 2025
1 parent 7babf22 commit cf30880
Show file tree
Hide file tree
Showing 21 changed files with 178 additions and 158 deletions.
16 changes: 16 additions & 0 deletions .changeset/tiny-otters-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@astrojs/alpinejs': patch
'@astrojs/tailwind': patch
'@astrojs/markdoc': patch
'@astrojs/preact': patch
'@astrojs/svelte': patch
'@astrojs/react': patch
'@astrojs/solid-js': patch
'@astrojs/mdx': patch
'@astrojs/vue': patch
'@astrojs/studio': patch
'astro': patch
'@astrojs/db': patch
---

Upgrades Vite
2 changes: 1 addition & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
},
"devDependencies": {
"@codspeed/vitest-plugin": "4.0.0",
"vitest": "^3.0.0-beta.4"
"vitest": "^3.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/container-with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"astro": "^5.1.7",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"vitest": "^3.0.0-beta.4"
"vitest": "^3.0.2"
},
"devDependencies": {
"@types/react": "^18.3.18",
Expand Down
2 changes: 1 addition & 1 deletion examples/with-vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"astro": "^5.1.7",
"vitest": "^3.0.0-beta.4"
"vitest": "^3.0.2"
}
}
4 changes: 2 additions & 2 deletions packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"unist-util-visit": "^5.0.0",
"unstorage": "^1.14.4",
"vfile": "^6.0.3",
"vite": "^6.0.7",
"vite": "^6.0.9",
"vitefu": "^1.0.5",
"which-pm": "^3.0.0",
"xxhash-wasm": "^1.1.0",
Expand Down Expand Up @@ -216,7 +216,7 @@
"sass": "^1.83.1",
"undici": "^7.2.1",
"unified": "^11.0.5",
"vitest": "^3.0.0-beta.4"
"vitest": "^3.0.2"
},
"engines": {
"node": "^18.17.1 || ^20.3.0 || >=22.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/test/fixtures/vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
},
"dependencies": {
"astro": "workspace:*",
"vitest": "^3.0.0-beta.4"
"vitest": "^3.0.2"
}
}
1 change: 1 addition & 0 deletions packages/astro/test/units/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export async function createFixture(tree) {

export function createRequestAndResponse(reqOptions = {}) {
const req = httpMocks.createRequest(reqOptions);
req.headers.host ||= 'localhost';

const res = httpMocks.createResponse({
eventEmitter: EventEmitter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,10 @@ describe('vite-plugin-astro-server', () => {
url: '/url?xyz=123',
});
container.handle(req, res);
assert.equal(res.statusCode, 200);

const html = await text();
assert.deepEqual(html, '<!DOCTYPE html>http://undefined/url?xyz=123');
assert.deepEqual(html, '<!DOCTYPE html>http://localhost/url?xyz=123');
});

it('params are excluded on prerendered routes', async () => {
Expand All @@ -121,7 +123,9 @@ describe('vite-plugin-astro-server', () => {
});
container.handle(req, res);
const html = await text();
assert.deepEqual(html, '<!DOCTYPE html>http://undefined/prerendered');
assert.equal(res.statusCode, 200);

assert.deepEqual(html, '<!DOCTYPE html>http://localhost/prerendered');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ describe('endpoints', () => {
await done;
const headers = res.getHeaders();
assert.deepEqual(headers, {
'access-control-allow-origin': '*',
'x-single': 'single',
'x-triple': 'one, two, three',
'set-cookie': ['hello', 'world'],
Expand Down
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@
"astro-scripts": "workspace:*",
"cheerio": "1.0.0",
"typescript": "^5.7.3",
"vite": "^6.0.7"
"vite": "^6.0.9"
}
}
2 changes: 1 addition & 1 deletion packages/integrations/alpinejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@playwright/test": "1.49.1",
"astro": "workspace:*",
"astro-scripts": "workspace:*",
"vite": "^6.0.7"
"vite": "^6.0.9"
},
"publishConfig": {
"provenance": true
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/markdoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"astro-scripts": "workspace:*",
"devalue": "^5.1.1",
"linkedom": "^0.18.6",
"vite": "^6.0.7"
"vite": "^6.0.9"
},
"engines": {
"node": "^18.17.1 || ^20.3.0 || >=22.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"remark-toc": "^9.0.0",
"shiki": "^1.26.2",
"unified": "^11.0.5",
"vite": "^6.0.7"
"vite": "^6.0.9"
},
"engines": {
"node": "^18.17.1 || ^20.3.0 || >=22.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@preact/signals": "^2.0.1",
"babel-plugin-transform-hook-names": "^1.0.2",
"preact-render-to-string": "^6.5.13",
"vite": "^6.0.7"
"vite": "^6.0.9"
},
"devDependencies": {
"astro": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"dependencies": {
"@vitejs/plugin-react": "^4.3.4",
"ultrahtml": "^1.5.3",
"vite": "^6.0.7"
"vite": "^6.0.9"
},
"devDependencies": {
"@types/react": "^18.3.18",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"dependencies": {
"vite-plugin-solid": "^2.11.0",
"vite": "^6.0.7"
"vite": "^6.0.9"
},
"devDependencies": {
"astro": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dependencies": {
"@sveltejs/vite-plugin-svelte": "^5.0.3",
"svelte2tsx": "^0.7.34",
"vite": "^6.0.7"
"vite": "^6.0.9"
},
"devDependencies": {
"astro": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/tailwind/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"astro": "workspace:*",
"astro-scripts": "workspace:*",
"tailwindcss": "^3.4.17",
"vite": "^6.0.7"
"vite": "^6.0.9"
},
"peerDependencies": {
"astro": "^3.0.0 || ^4.0.0 || ^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@vitejs/plugin-vue": "^5.2.1",
"@vitejs/plugin-vue-jsx": "^4.1.1",
"@vue/compiler-sfc": "^3.5.13",
"vite": "^6.0.7",
"vite": "^6.0.9",
"vite-plugin-vue-devtools": "^7.7.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"astro": "workspace:*",
"astro-scripts": "workspace:*",
"typescript": "^5.7.3",
"vite": "^6.0.7"
"vite": "^6.0.9"
}
}
Loading

0 comments on commit cf30880

Please sign in to comment.