-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Show relevant parts of the object/array for t.true/t.false assertion output #1205
Comments
@vadimdemedes thanks for pointing it out. I actually faced this thing last night and was thinking to open an issue. |
My suggestion in #1204 is to show the type of |
Guys, do you have any update regarding this request? I'm facing the same issue. 51: wrapper.unmount();
52: t.is(resetBehaviour.calledOnce, false);
53: });
Difference:
- true
+ false
Test.is (src/common/components/App/App.test.js:52:7)
processEmit [as emit] (node_modules/nyc/node_modules/signal-exit/index.js:155:32)
processEmit [as emit] (node_modules/nyc/node_modules/signal-exit/index.js:155:32) But if i use 51: wrapper.unmount();
52: t.false(resetBehaviour.calledOnce);
53: });
Value is not `false`:
true
resetBehaviour.calledOnce
=> true
resetBehaviour
=> Function proxy {
args: [
[],
],
callCount: 1,
callIds: [
4,
],
called: true,
calledOnce: true,
calledThrice: false,
calledTwice: false,
displayName: 'spy',
errorsWithCallStack: [
Error {
message: '',
},
],
exceptions: [
undefined,
],
firstCall: {
args: [],
callId: 4,
callback: undefined,
errorWithCallStack: Error {
message: '',
},
exception: undefined,
lastArg: undefined,
proxy: [Circular],
returnValue: undefined,
thisValue: {
resetBehaviour: [Circular],
},
},
id: 'spy#3',
instantiateFake: Function create {},
isSinonProxy: true,
lastCall: {
args: [],
callId: 4,
callback: undefined,
errorWithCallStack: Error {
message: '',
},
exception: undefined,
lastArg: undefined,
proxy: [Circular],
returnValue: undefined,
thisValue: {
resetBehaviour: [Circular],
},
},
notCalled: false,
returnValues: [
undefined,
],
secondCall: null,
thirdCall: null,
thisValues: [
{
resetBehaviour: [Circular],
},
],
toString: Function toString {},
}
Test.t [as fn] (src/common/components/App/App.test.js:52:5)
processEmit [as emit] (node_modules/nyc/node_modules/signal-exit/index.js:155:32)
processEmit [as emit] (node_modules/nyc/node_modules/signal-exit/index.js:155:32) I'm using sinon spies and the log output is completely uselesss in this case. |
@issuehunt has funded $60.00 to this issue.
|
FWIW, AVA no longer prints output like this, though it's supported through |
Note, this issue is related only to #1154.
Given this assertion:
if the size of
arr
is (for example)100
, AVA will output the whole array without pointing to the specific item that caused an assertion error. We should show only the relevant parts of the array/object to identify the cause of an issue quicker. Plus, we really don't want to trash user's terminal.IssueHunt Summary
Sponsors (Total: $60.00)
Become a sponsor now!
Or submit a pull request to get the deposits!
Tips
The text was updated successfully, but these errors were encountered: