mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 12:20:40 -07:00
20 lines
559 B
JavaScript
20 lines
559 B
JavaScript
import chai from 'chai'
|
|
import assert from '../../../src/util/assert.js'
|
|
|
|
const expect = chai.expect
|
|
|
|
describe('assert', function () {
|
|
it('should not throw if predicate is truthy', function () {
|
|
const fn = () => assert('foo', 'bar')
|
|
expect(fn).to.not.throw()
|
|
})
|
|
it('should not throw if predicate is truthy', function () {
|
|
const fn = () => assert('', 'bar')
|
|
expect(fn).to.throw(/bar/)
|
|
})
|
|
it('should populate default message', function () {
|
|
const fn = () => assert(false)
|
|
expect(fn).to.throw(/expect false to be true/)
|
|
})
|
|
})
|