Jest · Function
test
Jest lets you write JavaScript and TypeScript tests with assertions and matchers. Install it as a development dependency, add a test script, and run the tests with npm test or yarn test.
Last updated
Syntax
test(name, callback)
expect(value).toBe(expected)
beforeEach(callback)
afterEach(callback)
beforeAll(callback)
afterAll(callback)In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
expecttoBetest.onlydescribebeforeEachafterEachbeforeAllafterAll