Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
NghiaDTr committed Jul 19, 2024
1 parent c3b3541 commit 4d5f503
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions processor/tests/controllers/processor.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, test, jest, expect, beforeEach } from '@jest/globals';
import { NextFunction, Request, Response } from 'express';
import { Request, Response } from 'express';
import { post } from '../../src/controllers/processor.controller';

jest.mock('../../src/controllers/payment.controller', () => ({
Expand All @@ -8,7 +8,6 @@ jest.mock('../../src/controllers/payment.controller', () => ({

describe('Test processor.controller.ts', () => {
let res: Partial<Response>;
const next: NextFunction = jest.fn();

beforeEach(() => {
res = {
Expand Down Expand Up @@ -55,8 +54,7 @@ describe('Test processor.controller.ts', () => {
},
} as unknown as Request;

await post(request, res as Response, next);
// expect(next).toBeCalledTimes(1);
await post(request, res as Response);
expect(res.status).toBeCalledTimes(1);
expect(res.json).toBeCalledTimes(1);
});
Expand Down

0 comments on commit 4d5f503

Please sign in to comment.