mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 15:01:41 +03:00
chore: Enable typescript/no-explicit-any rule.
This commit is contained in:
@@ -10,6 +10,7 @@ const createRes = () => {
|
||||
status: vi.fn(),
|
||||
json: vi.fn(),
|
||||
headersSent: false,
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any;
|
||||
res.status.mockReturnValue(res);
|
||||
res.json.mockReturnValue(res);
|
||||
@@ -26,9 +27,11 @@ describe("createLineWebhookMiddleware", () => {
|
||||
const req = {
|
||||
headers: { "x-line-signature": sign(rawBody, secret) },
|
||||
body: rawBody,
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any;
|
||||
const res = createRes();
|
||||
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
await middleware(req, res, {} as any);
|
||||
|
||||
expect(res.status).toHaveBeenCalledWith(200);
|
||||
@@ -44,9 +47,11 @@ describe("createLineWebhookMiddleware", () => {
|
||||
const req = {
|
||||
headers: { "x-line-signature": sign(rawBody, secret) },
|
||||
body: Buffer.from(rawBody, "utf-8"),
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any;
|
||||
const res = createRes();
|
||||
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
await middleware(req, res, {} as any);
|
||||
|
||||
expect(res.status).toHaveBeenCalledWith(200);
|
||||
@@ -62,9 +67,11 @@ describe("createLineWebhookMiddleware", () => {
|
||||
const req = {
|
||||
headers: { "x-line-signature": sign(rawBody, secret) },
|
||||
body: rawBody,
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any;
|
||||
const res = createRes();
|
||||
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
await middleware(req, res, {} as any);
|
||||
|
||||
expect(res.status).toHaveBeenCalledWith(400);
|
||||
@@ -80,9 +87,11 @@ describe("createLineWebhookMiddleware", () => {
|
||||
const req = {
|
||||
headers: { "x-line-signature": "invalid-signature" },
|
||||
body: rawBody,
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any;
|
||||
const res = createRes();
|
||||
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
await middleware(req, res, {} as any);
|
||||
|
||||
expect(res.status).toHaveBeenCalledWith(401);
|
||||
@@ -99,9 +108,11 @@ describe("createLineWebhookMiddleware", () => {
|
||||
const req = {
|
||||
headers: { "x-line-signature": sign(rawBody, wrongSecret) },
|
||||
body: rawBody,
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
} as any;
|
||||
const res = createRes();
|
||||
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
await middleware(req, res, {} as any);
|
||||
|
||||
expect(res.status).toHaveBeenCalledWith(401);
|
||||
|
||||
Reference in New Issue
Block a user