-
Notifications
You must be signed in to change notification settings - Fork 509
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add tests for dev server and proxy (#644)
- Loading branch information
Showing
2 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { describe, it, expect } from "vitest"; | ||
import { setupTest, testNitro } from "../tests"; | ||
|
||
describe("nitro:preset:nitro-dev", async () => { | ||
const ctx = await setupTest("nitro-dev"); | ||
testNitro( | ||
ctx, | ||
() => { | ||
return async ({ url }) => { | ||
const res = await ctx.fetch(url); | ||
return res; | ||
}; | ||
}, | ||
(_ctx, callHandler) => { | ||
it("returns correct status for devProxy", async () => { | ||
const { status } = await callHandler({ url: "/proxy/example" }); | ||
expect(status).toBe(200); | ||
}); | ||
} | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters