-
-
Notifications
You must be signed in to change notification settings - Fork 109
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 tests for internal linking #808
Conversation
Awesome! Happy to see tests being worked on. Is there any downside to using a testing framework like jest? For testing jsx, we can use something like the React Testing Library. I'm currently working on a PR that sets this up. Linking test cases look great. |
No downside, just wanted to keep the first draft simple and didn't want to decide on a testing framework without discussion. But ime, jest is the standard for React apps so I agree with using jest. Will convert the code to use jest soon. |
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.
LGTM!
fd6513e
to
f29851b
Compare
New and removed dependencies detected. Learn more about Socket for GitHub ↗︎
|
Test output:
You are fast haha |
Since we mentioned tests in #804 and I noticed internal linking is a good candidate to start adopting tests, I added the simplest way to include tests for it that I could imagine.
This only uses the node internal
assert
package. No test framework required.I especially like how the tests document what behavior we want to see and prevent regressions.
Some drawbacks:
node **/*.spec.js
works with multiple test files but on first error, the whole test suite is aborted.Errors would look like this:
This is based on #807 and should thus be merged after.