Skip to content

Commit

Permalink
feat: separate test
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Aug 25, 2023
1 parent 3a9d872 commit 77128cc
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions test/core/test/jest-expect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,20 @@ describe('jest-expect', () => {
])
})

it('toThrow didn\'t throw', () => {
expect(() => {
expect(async () => {
}).toThrow(Error)
}).toThrowErrorMatchingInlineSnapshot('"expected function to throw an error, but it didn\'t"')
describe('toThrow', () => {
it('error wasn\'t thrown', () => {
expect(() => {
expect(() => {
}).toThrow(Error)
}).toThrowErrorMatchingInlineSnapshot('"expected function to throw an error, but it didn\'t"')
})

expect(() => {
it('async wasn\'t awaited', () => {
expect(() => {
}).toThrow(Error)
}).toThrowErrorMatchingInlineSnapshot('"expected function to throw an error, but it didn\'t"')
expect(async () => {
}).toThrow(Error)
}).toThrowErrorMatchingInlineSnapshot('"expected function to throw an error, but it didn\'t"')
})
})
})

Expand Down

0 comments on commit 77128cc

Please sign in to comment.