fix(auth): 移除测试中未使用的 token 变量(Docker tsc 严格模式)
This commit is contained in:
1 parent
3bb67ebf30
commit
c22913d955
1 file changed
-2
@@ -57,7 +57,6 @@ describe("POST /api/auth/login", () => {
|
|||||||
// 先注册一个用户
|
// 先注册一个用户
|
||||||
const phone = "13900139000";
|
const phone = "13900139000";
|
||||||
const password = "654321";
|
const password = "654321";
|
||||||
let token = "";
|
|
||||||
|
|
||||||
it("注册后登录成功返回 200 + token", async () => {
|
it("注册后登录成功返回 200 + token", async () => {
|
||||||
await request(app).post("/api/auth/register").send({ phone, password });
|
await request(app).post("/api/auth/register").send({ phone, password });
|
||||||
@@ -65,7 +64,6 @@ describe("POST /api/auth/login", () => {
|
|||||||
expect(res.status).toBe(200);
|
expect(res.status).toBe(200);
|
||||||
expect(typeof res.body.token).toBe("string");
|
expect(typeof res.body.token).toBe("string");
|
||||||
expect(res.body.user.phone).toBe(phone);
|
expect(res.body.user.phone).toBe(phone);
|
||||||
token = res.body.token;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("错误密码返回 401", async () => {
|
it("错误密码返回 401", async () => {
|
||||||
|
|||||||
Reference in new issue
Block a user