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

add test for project method #9303

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

AshwinNema
Copy link

Fixes #8373.
@Falke-Design I am new to contribute to open source and let me know if anything needs to be changed.

expect(a.y).to.be.equal(3101.3204602149353);
});

it('test the other corridinates', () => {
Copy link
Member

Choose a reason for hiding this comment

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

typo: corridinates should be coordinates

const x = latLng([40, 83]);
const b = map.project(x, 5);
expect(b.x).to.be.equal(5984.711111111111);
expect(b.y).to.be.equal(3101.3204602149353);
Copy link
Member

Choose a reason for hiding this comment

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

Floating point number literals with lots of decimals are scary in tests, since they can hit rounding errors.

Instead of equal, use https://www.chaijs.com/api/assert/#method_approximately with a delta of... 1/1000000, maybe?

1. typo fix : changing corridinates to coordinates

2.changing to.be.equal to to.be.approximately for round off approximation
@AshwinNema
Copy link
Author

@Falke-Design I have made requested changes. Please let me know if anything else has to be done.

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.

Implement test for 'project' method of Map
2 participants