Skip to content

breaking change in 2.0 (null, undefined, arguments, ok, true, false, empty, exist) #371

@JamesMessinger

Description

@JamesMessinger

Before the 2.0 release of Chai, these assertions could be written as properties or as functions. For example:

expect(foo).to.be.true;
expect(foo).to.be.true();

expect(foo).to.be.empty;
expect(foo).to.be.empty();

expect(foo).to.exist;
expect(foo).to.exist();

expect(foo).to.be.null;
expect(foo).to.be.null();

The documentation on chaijs.com even explained that this dual-syntax was there to play nice with some IDEs and linting tools that flag the non-function syntax as an error. But in 2.0, the function syntax no longer exists. Was it removed by accident, or was there a reason for it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions