|
1 |
| -import { MissingAPIRoute } from "../src/core/errors" |
| 1 | +// import { MissingAPIRoute } from "../src/core/errors" |
2 | 2 | import { nodeHandler } from "./utils"
|
3 | 3 |
|
4 | 4 | it("Missing req.url throws MISSING_NEXTAUTH_API_ROUTE_ERROR", async () => {
|
5 |
| - const { res, logger } = await nodeHandler() |
| 5 | + const { res } = await nodeHandler() |
6 | 6 |
|
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 | + // }) |
19 | 20 | })
|
20 | 21 |
|
21 | 22 | it("Missing host throws 400 in production", async () => {
|
|
0 commit comments