Testing Unitario y de integración
Herramientas
Jest
describe('module', () => {
it('test case', () => {
/* ... */`
})
}) beforeEach()
afterEach()
beforeAll()
afterAll() expect(value)
.not
.toBe(value)
.toBeInstanceOf(Class)
.toBeTruthy()
.toEqual(value)
.toHaveProperty(keyPath, value)
.toMatch(regexOrString)
.toMatchObject(object)
.toThrow(error)
.toThrowErrorMatchingSnapshot() const fn = jest.fn()
const fn = jest.fn(() => 'hello')
expect(fn)
.toHaveBeenCalled()
.toHaveBeenCalledTimes(number)
.toHaveBeenCalledWith(arg1, arg2, ...)@testing-library/react
render()
renderHook()
act()@testing-library/jest-dom
getBy()
findBy()
queryBy()
getAllBy()
findAllBy()
queryAllBy()Last updated