forked from kriasoft/react-starter-kit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.test.ts
More file actions
30 lines (27 loc) · 721 Bytes
/
app.test.ts
File metadata and controls
30 lines (27 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* SPDX-FileCopyrightText: 2014-present Kriasoft */
/* SPDX-License-Identifier: MIT */
import supertest from "supertest";
import { describe, expect, it } from "vitest";
import { app } from "./app";
describe("GET /trpc", () => {
it("returns NOT_FOUND response for unknown requests", async () => {
const res = await supertest(app).get("/trpc");
expect({
statusCode: res.statusCode,
body: res.body,
}).toEqual({
statusCode: 404,
body: {
error: {
code: -32004,
data: {
code: "NOT_FOUND",
httpStatus: 404,
path: "",
},
message: 'No "query"-procedure on path ""',
},
},
});
});
});