Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Chai v4 #22

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/dirty-chai.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ describe('dirty chai', function() {
describe('when false expression', function() {
it('should assert non-function at chain end', function() {
var assertion = expect(true).to.not.be.ok.and.not;
shouldFail(assertion.equal.bind(assertion, false), /expected true to be falsy/);
shouldFail(function () {
assertion.equal.call(assertion, false);
}, /expected true to be falsy/);
});

it('should assert with custom message at chain end', function() {
Expand Down Expand Up @@ -124,9 +126,9 @@ describe('dirty chai', function() {

it('should convert property to a chainable method', function() {
var prop = Object.getOwnPropertyDescriptor(chai.Assertion.prototype, 'neverFail');
chai.Assertion.prototype.should.have.a.property('neverFail').and.should.be.a('function');
(new chai.Assertion({})).should.have.a.property('neverFail').and.be.a('function');
prop.should.have.property('get').and.be.a('function');
prop.get.call(new chai.Assertion({})).should.be.a('function');
((new chai.Assertion({}).neverFail)).should.be.a('function');
});

it('should call assertion', function() {
Expand Down