Skip to content

Episode 12 should not do both tests with the same number #67

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

Closed
markm-dragoni opened this issue Dec 8, 2022 · 1 comment
Closed

Episode 12 should not do both tests with the same number #67

markm-dragoni opened this issue Dec 8, 2022 · 1 comment

Comments

@markm-dragoni
Copy link

const coerceAmount = (amount: number | { amount: number }) => {
  return 20;
};

it("Should return the amount when passed an object", () => {
  expect(coerceAmount({ amount: 20 })).toEqual(20);
});

it("Should return the amount when passed a number", () => {
  expect(coerceAmount(20)).toEqual(20);
});

Ex 12 can be passed with just returning 20, perhaps the tests should use two different numbers to make this work around less obvious?

@mattpocock
Copy link
Collaborator

This seems fine to me!

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

No branches or pull requests

2 participants