bahmutov/lazy-ass

View on GitHub
__tests__/default-export-test.ts

Summary

Maintainability
A
0 mins
Test Coverage
import la from '../src'

describe('lazy-ass as default export', () => {
  it('does not throw if condition is true', () => {
    la(true)
  })

  it('does not throw when there is a message', () => {
    la(true, 'text', 42, 'more text')
  })

  it('throws nice message', () => {
    expect(() => {
      la(false, 'text', 42, 'more text')
    }).toThrowErrorMatchingSnapshot()
  })
})