Skip to content

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