I have to write my unit test case in jest, can someone help me with error I am getting.
this is my service method to get list of users: async getAllUsers(): Promise<UserDto[]>{ return this.queryBus.execute<UsersQuery, UserDto[]>(new UsersQuery()); } this is my test case: describe('getUsers', () => { describe('get users is called', () => { let users: User[]; //axios.get.mockResolvedValue(resp); beforeEach(async () => { await userController.getAllUsers(); }) test('it will call the user service', async() => { expect(await userService.getAllUsers()).toHaveBeenCalled(); }) test('return all the users', () => { expect(users).toEqual([userDTOStub()]) }) }) }); when i run this method it is telling type error: TypeError: metatype is not a constructor. how to compare the promise with mock sample data.