We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems like Chai supports key assertions on ES2015 sets & maps (introduced in this PR: #633), but it does not support simple "inclusion" assertions.
Consider the following testcase:
it("should detect item existence in Set", function () { let container = new Set(); container.add(123); expect(container).to.include(123); });
This test should obviously pass, as the container has 123 value added to it. Instead, it fails with the following error:
container
123
AssertionError: object tested must be an array, an object, or a string, but set given
Same thing happens if we change Set to Map (container.set("somekey", 123)).
Set
Map
container.set("somekey", 123)
As far as I know, this problem occurs both in 3.5.0 version, as well as the latest 4.0.0-canary.2 pre-release version.
3.5.0
4.0.0-canary.2
The text was updated successfully, but these errors were encountered:
@mdziekon Agreed. This one seems fairly straightforward. @lucasfcosta @vieiralucas @shvaikalesh @keithamus Any objection to requesting a PR?
Sorry, something went wrong.
I totally agree. Seems simple, straightforward and also very useful.
LGTM
No branches or pull requests
It seems like Chai supports key assertions on ES2015 sets & maps (introduced in this PR: #633), but it does not support simple "inclusion" assertions.
Consider the following testcase:
This test should obviously pass, as the
container
has123
value added to it. Instead, it fails with the following error:Same thing happens if we change
Set
toMap
(container.set("somekey", 123)
).As far as I know, this problem occurs both in
3.5.0
version, as well as the latest4.0.0-canary.2
pre-release version.The text was updated successfully, but these errors were encountered: