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

test(ava-xs): document bug in deepEqual #5398

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

turadg
Copy link
Member

@turadg turadg commented May 19, 2022

closes: #XXXX
refs: #XXXX

Description

Security Considerations

Documentation Considerations

Testing Considerations

@turadg
Copy link
Member Author

turadg commented May 19, 2022

@dckc where should a test like this go? where it is fails because it runs in regular Ava which functions correctly. It's only in ava-xs that it fails.

@dckc
Copy link
Member

dckc commented May 19, 2022

The bug should be fixed rather than documented, no?

Note also plans to move ava-xs and xsnap to endo:

@turadg
Copy link
Member Author

turadg commented May 19, 2022

The bug should be fixed rather than documented, no?

Sure, it should. Given priorities, this is what I have time for. And it's work that would have to be done anyway for a fix: a test.

So… where should a test like this go? I can't find any testing of the avaAssertXs module.

@dckc
Copy link
Member

dckc commented May 19, 2022

I'm not used to testing test harnesses. But the filename you picked seems as good as any.

@erights
Copy link
Member

erights commented May 20, 2022

What bug in deepEqual? I could not tell from the PR.

@turadg
Copy link
Member Author

turadg commented May 21, 2022

What bug in deepEqual? I could not tell from the PR.

t.deepEqual({ num: 1 }, { num: 2 }) is passing when run in ava-xs. That isn't run in CI because there are no tests of packages/xsnap/src/avaAssertXS.js`.

I'm not used to testing test harnesses.

Sure, when consuming a test harness. In this case, the package is making an assertion library. That's what needs tests, just like Ava does https://github.com/avajs/ava/blob/e387cba63ccf1a24a96b2375d61738ca38f48082/test-tap/assert.js#L368

I think the trick will be to define the t object separately from avaAssertXS.js so it can be worked with as a specimen instead of on the global object. Then regular Ava can be used to test it.

Copy link
Member

@dckc dckc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to talk this over.

@@ -142,6 +141,8 @@ async function runTestScript(
assertionStatus[msg.status] += 1;
if (msg.status === 'not ok') {
console.warn({ ...msg, filename, label });
testStatus.total += 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to mix up counting tests with counting assertions. I wonder why the logic below here doesn't suffice.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a thought: 3472734

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants