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 unit tests #594

Merged
merged 5 commits into from
Dec 3, 2022
Merged

Add unit tests #594

merged 5 commits into from
Dec 3, 2022

Conversation

1ec5
Copy link
Member

@1ec5 1ec5 commented Dec 1, 2022

Installed Mocha and Chai as development dependencies so that we can write unit tests for parts of this application that can run independently of a browser. Unit tests run as a continuous integration check, or you can run them manually using npm test. As a starting point, I added tests of a trivial URL parsing function from #581, but more will come as part of #592.

Updated various documentation to reflect the current state of the deployed map.

Added basic usage instructions to the readme, including about configuring the language. Formatted the acknowledgements as Markdown and added the mapbox-gl-rtl-text plugin. Mentioned unit tests in the contributing guide.
@1ec5 1ec5 added documentation Improvements or additions to documentation build labels Dec 1, 2022
@1ec5 1ec5 requested a review from jleedev December 1, 2022 20:56
@1ec5 1ec5 self-assigned this Dec 1, 2022
@1ec5 1ec5 marked this pull request as ready for review December 1, 2022 20:56
package.json Outdated Show resolved Hide resolved
.github/workflows/test-build.yml Outdated Show resolved Hide resolved
"create-serve": "^1.0.1",
"esbuild": "^0.15.15",
"maplibre-gl": "^2.1.9",
"mocha": "^10.1.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

I got some valuable feedback on Slack that Mocha/Chai is outmoded and Jest would be more fashionable. However, with the recently released Node 19 including a first-party test runner out of the box, it’s only a matter of time before we switch to that instead, given our very lightweight testing needs. For the time being, I’d like to unblock #592 while respecting this project’s support for Node LTS, so I’ll keep this choice of dependencies for now, with an eye towards rewriting the unit tests once we make a decision to drop Node 18 support.

.github/workflows/test-build.yml Outdated Show resolved Hide resolved
@1ec5 1ec5 requested a review from jleedev December 2, 2022 08:08
@1ec5 1ec5 merged commit 178ab61 into main Dec 3, 2022
@1ec5 1ec5 deleted the 1ec5-test branch December 3, 2022 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants