Files
liquidjs/test/unit/util/assert.ts
T
harttle ae45c4622e fix: break/continue omitting output before them, #123
BREAKING CHANGE: remove default export, now should be used like import
{Liquid} from 'liquidjs'
2019-08-26 10:15:43 -05:00

20 lines
565 B
TypeScript

import * as chai from 'chai'
import { assert } from '../../../src/util/assert'
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/)
})
})