-
Notifications
You must be signed in to change notification settings - Fork 0
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
Standardise how we test the length of an array #190
Conversation
In our unit tests we had been checking the length of an array using the method `expect(result.length).to.equal(1)`. However our preferred way to test the length of an array is `expect(result).to.have.length(1)`. This PR updates all unit tests to use the `expect(result).to.have.length(1)` method to test the length of an array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small change to the tests where we're checking .to.have.length(0)
-- might read better to use .to.be.empty()
instead?
test/services/supplementary-billing/fetch-charge-versions.service.test.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
In our unit tests we had been checking the length of an array using the method
expect(result.length).to.equal(1)
. However our preferred way to test the length of an array isexpect(result).to.have.length(1)
.This PR updates all unit tests to use the
expect(result).to.have.length(1)
method to test the length of an array.