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

toEqual do not work correctly with objects having both jasmine.any and Buffer #8960

Closed
Skriptach opened this issue Sep 17, 2019 · 2 comments
Closed

Comments

@Skriptach
Copy link

To Reproduce

  1. Run test
const { ObjectId } = require('mongodb');

describe('Post route', () => {
	it('should invoke insertOne when receiving /post request', async () => {
		const userId = ObjectId();

		const expectedArg = {
			ts: jasmine.any(Number),
			// userId,
		};

		const actualArgs = {
			ts: Date.now(),
			// userId: userId.toString(),
		};
		expect(actualArgs).toEqual(expectedArg);
	});
});
  1. Confirm there is no fails

  2. Uncomment all userId lines and run test again

  3. See it fails and ts field highlighted as mismatch. But userId not .
    image

  4. Comment all ts fileds and run test again

  5. Now failed on userId
    image

Expected behavior

When both fields are uncommented should not highlight ts as wrong but userId should

@jeysal
Copy link
Contributor

jeysal commented Sep 17, 2019

This is a duplicate of #6184.
It looks slightly more complex in this case, but if that was fixed, the ts difference would not be printed anymore and it would correctly fall back to the userId difference printed with toJSON.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants