Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved chai-assert into main chai definition
renamed chai-fuzzy-assert to chai-fuzzy
- Loading branch information
Showing
7 changed files
with
741 additions
and
791 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
dfab9f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change broke our usage of chai. Previously we were using chai-assert.d.ts and accessing the assertions via the global "assert" variable. After upgrading the global variable is missing and using "chai.assert" to access assertions doesn't work. There is also one other negative aspect to this change: previously we only used the assert library but now the expect library is also exposed to developers.
dfab9f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having them separate file was not according to the DT style ("chai.assert" was an artifact and doesn't exists as separate entity in chai itself).
Adding them to the main chai definition matches the way the JS code is distributed. This matches the usage pattern in chai's docs and works:
And afaik there is no global 'assert' variable in chai; it is an artifact of how people use it (by assigning it to a global somehwere and then in the test assume it is there), so doesn't belong in the definitions either.
dfab9f5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doh, you are right - I was looking to see if we had a global assignment somewhere and I totally missed it. Thanks for the explanation - that makes sense.