jest
测试代码片段
describe("number test", ()=>{
it('1 is true', ()=>{
expect(1).toBeTruthy()
})
test('2 is true',()=>{
expect(2).toBeTruthy()
})
})
- describe 描述,
decribe
会形成一个作用域 - it 断言
- expect 期望
- test 测试,类似
it
jest
测试代码片段describe("number test", ()=>{
it('1 is true', ()=>{
expect(1).toBeTruthy()
})
test('2 is true',()=>{
expect(2).toBeTruthy()
})
})
decribe
会形成一个作用域it