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(omit) : Enhance omit function tests #42

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

sossost
Copy link
Contributor

@sossost sossost commented Jun 13, 2024

Description:
Add additional test cases for the omit function to ensure comprehensive coverage

Changes:

  1. Add test case to check if all keys are omitted:
  • Verifies that the function returns an empty object when all keys are omitted.
it('should return an empty object if all keys are omitted', () => {
  const obj = { a: 1, b: 2, c: 3 };
  const result = omit(obj, ['a', 'b', 'c']);
  expect(result).toEqual({});
});
  1. Add test case to check if no keys are omitted:
  • Verifies that the function returns the original object when no keys are omitted.
it('should return the same object if no keys are omitted', () => {
  const obj = { a: 1, b: 2, c: 3 };
  const result = omit(obj, []);
  expect(result).toEqual({ a: 1, b: 2, c: 3 });
});
  1. Add test case to check that the original object is not mutated:
  • Ensures that the function does not modify the original object and returns a new object instead.
it('should not affect the original object', () => {
  const obj = { a: 1, b: 2, c: 3 };
  const result = omit(obj, ['b']);
  expect(result).toEqual({ a: 1, c: 3 });
  expect(obj).toEqual({ a: 1, b: 2, c: 3 });
});

Copy link

vercel bot commented Jun 13, 2024

@sossost is attempting to deploy a commit to the Toss Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@raon0211 raon0211 left a comment

Choose a reason for hiding this comment

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

Thanks!

@raon0211 raon0211 merged commit c7dd4a3 into toss:main Jun 13, 2024
5 of 6 checks passed
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.

None yet

2 participants