Skip to content

Commit

Permalink
chore(astro-tests): Export TestApp type
Browse files Browse the repository at this point in the history
  • Loading branch information
Fryuni committed Sep 21, 2024
1 parent 4645b10 commit e0d26fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-mayflies-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@inox-tools/astro-tests': patch
---

Export `TestApp` type
8 changes: 4 additions & 4 deletions packages/astro-tests/src/astroFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export type NodeResponse = import('node:http').ServerResponse;
export type DevServer = Awaited<ReturnType<typeof dev>>;
export type PreviewServer = Awaited<ReturnType<typeof preview>>;

type TestApp = {
export type TestApp = {
render: (req: Request) => Promise<Response>;
toInternalApp: () => App;
};
Expand Down Expand Up @@ -224,9 +224,9 @@ export async function loadFixture(inlineConfig: InlineConfig): Promise<Fixture>
const onNextChange = () =>
devServer
? new Promise<void>((resolve) =>
// TODO: Implement filter to only resolve on changes to a given file.
devServer.watcher.once('change', () => resolve())
)
// TODO: Implement filter to only resolve on changes to a given file.
devServer.watcher.once('change', () => resolve())
)
: Promise.reject(new Error('No dev server running'));

// Also do it on process exit, just in case.
Expand Down

0 comments on commit e0d26fa

Please sign in to comment.