toHaveBeenCalledTimes(expected: number)
expect(coffeeRepositroy.create).toHaveBeenCalledTimes(1)
toHaveBeenCalledWith()
mock funtion가 호출될 때 어떤 인수와 호출되는지 확인
Ex)
expect(coffeeRepositroy.create).toHaveBeenCalledWith(createAccountArgs)
expect(coffeeRepositroy.create).toHaveBeenCalledWith(
expect.any(String),
expect.any(String)
)
toHaveBeenCalled()
expect(coffeeRepositroy.create).toHaveBeenCalled()
toMathObject()
expect(result).toMatchObject({ ok: false, error: 'Already Done', });
toBeDefined()
expect(service).toBeDefined();
toEqual()
expect(result).toEqual({ ok: false, error: 'Already Done', });