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

added module-2 solution #47

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

Conversation

kornel-filep
Copy link

No description provided.

it('should return negative value when negative number', () => expect(calc(-3).v).equal(-3))
})
describe('add', () => {
it('should return 8 when adding 3 and 5', () => expect(calc(3).add(5).v).equal(8))
Copy link
Author

Choose a reason for hiding this comment

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

I skipped the.to.be part to minimize unnecessary boilerplate code, cause here the .to.be would not really increase readability.
Is it a bad practice? How is it used more in practice? (skipped or the .to.be and similar chain getters are just always there?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

However, skipping the fillers does not affect the assertion itself, but still, in practice, we use them to be a bit more human-like and easy to adopt.
In some simple cases, this is not too talkative at all, but from a consistency perspective, I would suggest to use them.

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.

2 participants