-
Notifications
You must be signed in to change notification settings - Fork 59
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
Add unit tests #594
Conversation
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.
"create-serve": "^1.0.1", | ||
"esbuild": "^0.15.15", | ||
"maplibre-gl": "^2.1.9", | ||
"mocha": "^10.1.0", |
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.
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.
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.