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

fix: fixed incorrect assertion in jest-worker unit tests. #15467

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mohammednumaan
Copy link
Contributor

Summary

The unit test in jest-workers package had an incorrect assertion as show below:

Failing Test:
image

The source code for the above test can be found here

As we can see, the assertion in the above linked file is incorrect. We need to compare the actual object and not the type of it. Removing the typeof operator and passing the object is the correct assertion.

This PR fixes this issue by removing the typeof operator:

expect(farm1).toEqual(
    expect.not.objectContaining({
      _shouldNotExist: expect.anything,
    }),
);
Note: I've found out that, in PR requests, this very test case/check fails due to the incorrect assertion.

Test plan

The test passes after removing the typeof operator.
image

The commands I ran are:

yarn jest /packages/jest-worker/src/__tests__/index.test.ts

Copy link

netlify bot commented Jan 17, 2025

Deploy Preview for jestjs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 31dec0e
🔍 Latest deploy log https://app.netlify.com/sites/jestjs/deploys/678a46abbb988a0008acd557
😎 Deploy Preview https://deploy-preview-15467--jestjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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.

1 participant