sawhney17 / logseq-automatic-linker

MIT License
97 stars 18 forks source link

test: add tests to avoid regressions #32

Closed andreoliwa closed 2 years ago

andreoliwa commented 2 years ago

⚠️ Depends on this other pull request to be merged first: https://github.com/sawhney17/logseq-automatic-linker/pull/30 ⚠️

sawhney17 commented 2 years ago

Looks very cool! Don't have experience myself with testing especially with a logseq plug-in which makes this especially interesting to me. I guess we could run the tests through a GitHub workflow as well for PRs correct?

andreoliwa commented 2 years ago

I guess we could run the tests through a GitHub workflow as well for PRs correct?

Yes. I don't know how to do that with TypeScript projects that's why I didn't do it here...

Looks very cool! Don't have experience myself with testing especially with a logseq plug-in which makes this especially interesting to me

I tried to isolate the function that actually does the parsing/replacement to use unit tests. It's a good start, in my opinion. I also don't know how to mock Logseq if we would need to use it in tests.

andreoliwa commented 2 years ago

I guess we could run the tests through a GitHub workflow as well for PRs correct?

I just added a workflow to run the tests on GitHub Actions.

sawhney17 commented 2 years ago

awesome. Merging now!