Skip to content

Commit 0a140cd

Browse files
committedDec 8, 2022
test(core): fix test
1 parent 157269e commit 0a140cd

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed
 

‎packages/next-auth/tests/next.test.ts

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
import { MissingAPIRoute } from "../src/core/errors"
1+
// import { MissingAPIRoute } from "../src/core/errors"
22
import { nodeHandler } from "./utils"
33

44
it("Missing req.url throws MISSING_NEXTAUTH_API_ROUTE_ERROR", async () => {
5-
const { res, logger } = await nodeHandler()
5+
const { res } = await nodeHandler()
66

7-
expect(res.status).toBeCalledWith(500)
8-
expect(logger.error).toBeCalledTimes(1)
9-
expect(logger.error).toBeCalledWith(
10-
"MISSING_NEXTAUTH_API_ROUTE_ERROR",
11-
expect.any(MissingAPIRoute)
12-
)
13-
expect(res.setHeader).toBeCalledWith("content-type", "application/json")
14-
const body = res.send.mock.calls[0][0]
15-
expect(JSON.parse(body)).toEqual({
16-
message:
17-
"There is a problem with the server configuration. Check the server logs for more information.",
18-
})
7+
expect(res.status).toBeCalledWith(400)
8+
// Moved to host detection in getUrl
9+
// expect(logger.error).toBeCalledTimes(1)
10+
// expect(logger.error).toBeCalledWith(
11+
// "MISSING_NEXTAUTH_API_ROUTE_ERROR",
12+
// expect.any(MissingAPIRoute)
13+
// )
14+
// expect(res.setHeader).toBeCalledWith("content-type", "application/json")
15+
// const body = res.send.mock.calls[0][0]
16+
// expect(JSON.parse(body)).toEqual({
17+
// message:
18+
// "There is a problem with the server configuration. Check the server logs for more information.",
19+
// })
1920
})
2021

2122
it("Missing host throws 400 in production", async () => {

0 commit comments

Comments
 (0)
Please sign in to comment.