Skip to content

Commit cf30880

Browse files
authored
fix: upgrade Vite and update tests (#13011)
* fix: upgrade Vite and update tests * chore: remove cors header snapshot * chore: upgrade Vitest * chore: revert edit * chore: changeset
1 parent 7babf22 commit cf30880

File tree

21 files changed

+178
-158
lines changed

21 files changed

+178
-158
lines changed

.changeset/tiny-otters-hear.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
'@astrojs/alpinejs': patch
3+
'@astrojs/tailwind': patch
4+
'@astrojs/markdoc': patch
5+
'@astrojs/preact': patch
6+
'@astrojs/svelte': patch
7+
'@astrojs/react': patch
8+
'@astrojs/solid-js': patch
9+
'@astrojs/mdx': patch
10+
'@astrojs/vue': patch
11+
'@astrojs/studio': patch
12+
'astro': patch
13+
'@astrojs/db': patch
14+
---
15+
16+
Upgrades Vite

benchmark/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@
2525
},
2626
"devDependencies": {
2727
"@codspeed/vitest-plugin": "4.0.0",
28-
"vitest": "^3.0.0-beta.4"
28+
"vitest": "^3.0.2"
2929
}
3030
}

examples/container-with-vitest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"astro": "^5.1.7",
1616
"react": "^18.3.1",
1717
"react-dom": "^18.3.1",
18-
"vitest": "^3.0.0-beta.4"
18+
"vitest": "^3.0.2"
1919
},
2020
"devDependencies": {
2121
"@types/react": "^18.3.18",

examples/with-vitest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
},
1313
"dependencies": {
1414
"astro": "^5.1.7",
15-
"vitest": "^3.0.0-beta.4"
15+
"vitest": "^3.0.2"
1616
}
1717
}

packages/astro/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
"unist-util-visit": "^5.0.0",
169169
"unstorage": "^1.14.4",
170170
"vfile": "^6.0.3",
171-
"vite": "^6.0.7",
171+
"vite": "^6.0.9",
172172
"vitefu": "^1.0.5",
173173
"which-pm": "^3.0.0",
174174
"xxhash-wasm": "^1.1.0",
@@ -216,7 +216,7 @@
216216
"sass": "^1.83.1",
217217
"undici": "^7.2.1",
218218
"unified": "^11.0.5",
219-
"vitest": "^3.0.0-beta.4"
219+
"vitest": "^3.0.2"
220220
},
221221
"engines": {
222222
"node": "^18.17.1 || ^20.3.0 || >=22.0.0",

packages/astro/test/fixtures/vitest/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
},
99
"dependencies": {
1010
"astro": "workspace:*",
11-
"vitest": "^3.0.0-beta.4"
11+
"vitest": "^3.0.2"
1212
}
1313
}

packages/astro/test/units/test-utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export async function createFixture(tree) {
4444

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

4849
const res = httpMocks.createResponse({
4950
eventEmitter: EventEmitter,

packages/astro/test/units/vite-plugin-astro-server/request.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,10 @@ describe('vite-plugin-astro-server', () => {
110110
url: '/url?xyz=123',
111111
});
112112
container.handle(req, res);
113+
assert.equal(res.statusCode, 200);
114+
113115
const html = await text();
114-
assert.deepEqual(html, '<!DOCTYPE html>http://undefined/url?xyz=123');
116+
assert.deepEqual(html, '<!DOCTYPE html>http://localhost/url?xyz=123');
115117
});
116118

117119
it('params are excluded on prerendered routes', async () => {
@@ -121,7 +123,9 @@ describe('vite-plugin-astro-server', () => {
121123
});
122124
container.handle(req, res);
123125
const html = await text();
124-
assert.deepEqual(html, '<!DOCTYPE html>http://undefined/prerendered');
126+
assert.equal(res.statusCode, 200);
127+
128+
assert.deepEqual(html, '<!DOCTYPE html>http://localhost/prerendered');
125129
});
126130
});
127131
});

packages/astro/test/units/vite-plugin-astro-server/response.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ describe('endpoints', () => {
7474
await done;
7575
const headers = res.getHeaders();
7676
assert.deepEqual(headers, {
77-
'access-control-allow-origin': '*',
7877
'x-single': 'single',
7978
'x-triple': 'one, two, three',
8079
'set-cookie': ['hello', 'world'],

packages/db/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,6 @@
9191
"astro-scripts": "workspace:*",
9292
"cheerio": "1.0.0",
9393
"typescript": "^5.7.3",
94-
"vite": "^6.0.7"
94+
"vite": "^6.0.9"
9595
}
9696
}

0 commit comments

Comments
 (0)