chore: migrate test cases from Chai to Jest

This commit is contained in:
Harttle
2023-03-20 00:41:06 +08:00
committed by Jun Yang
parent dccb90c591
commit c6cde9cd10
97 changed files with 8163 additions and 26440 deletions
+16
View File
@@ -0,0 +1,16 @@
import { assert } from './assert'
describe('assert', function () {
it('should not throw if predicate is truthy', function () {
const fn = () => assert('foo', () => 'bar')
expect(fn).not.toThrow()
})
it('should not throw if predicate is truthy', function () {
const fn = () => assert('', () => 'bar')
expect(fn).toThrow(/bar/)
})
it('should populate default message', function () {
const fn = () => assert(false)
expect(fn).toThrow(/expect false to be true/)
})
})