jest四个钩子函数
sonder 小杯

beforeAll

1
2
3
beforeAll(()  => {
// console.log('所有测试用例之前执行')
})

beforeEach

1
2
3
beforeEach(()  => {
// console.log('每个测试用例之前执行')
})

afterEach

1
2
3
 afterEach(()  => {
// console.log('每个测试用例之后执行')
})

afterAll

1
2
3
afterAll(() => {
// console.log('所有测试用例之后执行')
})
  • 本文标题:jest四个钩子函数
  • 本文作者:sonder
  • 创建时间:2020-06-07 20:46:38
  • 本文链接:https://sonderss.github.io/2020/06/07/jest四个钩子函数/
 评论