Skip to content

Commit dc2d9c3

Browse files
committed
Fix breaking unit tests
- request.test.js removed old test where implementation has changed - head.test.js fixed by fixing the test-utils pipeline implementation
1 parent 96972be commit dc2d9c3

File tree

3 files changed

+1
-45
lines changed

3 files changed

+1
-45
lines changed

packages/astro/src/runtime/server/render/astro/instance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export class AstroComponentInstance {
8686

8787
// Issue warnings for invalid props for Astro components
8888
function validateComponentProps(
89-
props: any,
89+
props: ComponentProps,
9090
clientDirectives: SSRResult['clientDirectives'],
9191
displayName: string,
9292
) {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ export function createBasicPipeline(options = {}) {
110110
options.mode ?? 'development',
111111
options.renderers ?? [],
112112
options.resolve ?? ((s) => Promise.resolve(s)),
113-
options.serverLike ?? true,
114113
options.streaming ?? true,
115114
options.adapterName,
116115
options.clientDirectives ?? getDefaultClientDirectives(),

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

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -48,49 +48,6 @@ async function createDevApp(overrides = {}, root) {
4848
}
4949

5050
describe('vite-plugin-astro-server', () => {
51-
describe('request', () => {
52-
it('renders a request', async () => {
53-
const fixture = await createFixture({
54-
// Note that the content doesn't matter here because we are using a custom loader.
55-
'/src/pages/index.astro': '',
56-
});
57-
58-
const app = await createDevApp(
59-
{
60-
loader: createLoader({
61-
import(id) {
62-
if (id === '\0virtual:astro:middleware') {
63-
return { onRequest: (_, next) => next() };
64-
}
65-
const Page = createComponent(() => {
66-
return render`<div id="test">testing</div>`;
67-
});
68-
return createAstroModule(Page);
69-
},
70-
}),
71-
},
72-
fixture.path,
73-
);
74-
75-
const controller = createController({ loader: app.pipeline.loader });
76-
const { req, res, text } = createRequestAndResponse();
77-
78-
try {
79-
await app.handleRequest({
80-
controller,
81-
incomingRequest: req,
82-
incomingResponse: res,
83-
});
84-
} catch (err) {
85-
assert.equal(err.message, undefined);
86-
}
87-
88-
const html = await text();
89-
assert.equal(res.statusCode, 200);
90-
assert.equal(html.includes('<div id="test">'), true);
91-
});
92-
});
93-
9451
describe('url', () => {
9552
let container;
9653
let settings;

0 commit comments

Comments
 (0)