Skip to content

Commit

Permalink
fix: adjust error in test
Browse files Browse the repository at this point in the history
  • Loading branch information
DominMFD committed Sep 16, 2024
1 parent 32a0c56 commit 9d56878
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/features/twitter/controllers/twitter-controller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe('[Controller] Twitter', () => {
let authorizeTwitterService: AuthorizeTwitterService;
let loginTwitterService: LoginTwitterService;
let authController: TwitterController;
let error: HttpError;

let req: Request;
let res: Response;
Expand All @@ -38,6 +39,7 @@ describe('[Controller] Twitter', () => {
authorizeTwitterService,
loginTwitterService
);
error = new HttpError(HttpStatusCode.serverError, 'error');
});

describe('callback', () => {
Expand All @@ -63,7 +65,6 @@ describe('[Controller] Twitter', () => {
expect(res.json).toHaveBeenCalledWith('url');
}),
it('should be return a error', () => {
const error = new HttpError(HttpStatusCode.badRequest, 'Message Error');
vi.spyOn(loginTwitterService, 'execute').mockImplementation(() => {
throw error;
});
Expand Down

0 comments on commit 9d56878

Please sign in to comment.