-
-
Notifications
You must be signed in to change notification settings - Fork 697
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
isAtLeast()
creates misleading output
#1518
Comments
Right the diff doesn't make sense here. I feel like the default message does hint towards how this is working but I agree.
|
@koddsson I try this job start, but there is a problem. The behavior of the assert.isAtLeast function that I understand from the code is as follows. chai/lib/chai/core/assertions.js Lines 1312 to 1371 in 936c0ca
The Atleast function executes the assertLeast function, and if there is no type error, it executes this.assert. Lines 123 to 148 in 936c0ca
The assert function compares the actual value and the expected value to determine whether it passes or not, and then throws an error object when an error occurs. When an error occurs, a message and information are formatted and displayed using a report library such as mocha. If the above execution flow is correct, the change inside the assert function to correct the -+ error below is too large, so it seems that the assert function logic needs to be moved and modified inside the least function. However, rather than changing it like this without showing the diff itself, how about including information that there is an error in the expected value in the error message returned if it is not a basic error message? for example,
|
I have a test comparing timestamps:
on failure, the output is:
Using expected/actual is difficult here, because there is no expected value but a range of values. If you want to stick to that still, you could use this output instead:
Maybe even drop the left comparand:
The text was updated successfully, but these errors were encountered: