Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
fix: throw error if no chai
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jan 27, 2018
1 parent beb2b88 commit 84b4c18
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/chai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,4 @@ const tryRequire = (module: string) => {

const chai: Chai.ChaiStatic = tryRequire('chai')

const chaiAsPromised = tryRequire('chai-as-promised')
if (chai && chaiAsPromised) chai.use(chaiAsPromised)

export const expect = chai && chai.expect
export const expect = (chai && chai.expect) || (() => { throw new Error('install chai') })

2 comments on commit 84b4c18

@agajic-modoolar
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdxcode Is there any reason why chai-as-promised was removed? Docs still state that it's preloaded by default.

@jdx
Copy link
Collaborator Author

@jdx jdx commented on 84b4c18 Jan 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember. I'm pretty sure this was before the public release though so I should update the docs.

Please sign in to comment.