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

Standardise how we test the length of an array #190

Merged
merged 4 commits into from
Apr 14, 2023
Merged

Conversation

Jozzey
Copy link
Contributor

@Jozzey Jozzey commented Apr 13, 2023

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.

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.
@Jozzey Jozzey self-assigned this Apr 13, 2023
@Jozzey Jozzey added the housekeeping Refactoring, tidying up or other work which supports the project label Apr 13, 2023
@Jozzey Jozzey marked this pull request as ready for review April 13, 2023 15:42
@Jozzey Jozzey requested review from StuAA78 and Beckyrose200 April 13, 2023 15:42
Beckyrose200
Beckyrose200 previously approved these changes Apr 14, 2023
Copy link
Contributor

@Beckyrose200 Beckyrose200 left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@StuAA78 StuAA78 left a 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?

Copy link
Contributor

@StuAA78 StuAA78 left a comment

Choose a reason for hiding this comment

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

👍

@Jozzey Jozzey merged commit 84bc859 into main Apr 14, 2023
@Jozzey Jozzey deleted the standardise-length-tests branch April 14, 2023 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants