The goal of this PR is to introduce the vitest framework for unit testing. It'll be difficult to unit test everything, since, by nature, the plugin depends on the obsidian API, which isn't available during testing. But, some important, finicky bits of functionality can be extracted, where appropriate, and some unit tests can be made for them. This PR introduces one example of where it would be beneficial to have unit tests.
The tests, right now, are failing because I haven't yet updated the production code to fix #189. I figure, if you're OK with introducing the test framework, then that bug can be fixed in another PR.
Also, I chose vitest instead of jest because, in my experience, vitest is just so much faster. Even though it's actually built on top of jest, it somehow runs much better.
The goal of this PR is to introduce the vitest framework for unit testing. It'll be difficult to unit test everything, since, by nature, the plugin depends on the obsidian API, which isn't available during testing. But, some important, finicky bits of functionality can be extracted, where appropriate, and some unit tests can be made for them. This PR introduces one example of where it would be beneficial to have unit tests.
The tests, right now, are failing because I haven't yet updated the production code to fix #189. I figure, if you're OK with introducing the test framework, then that bug can be fixed in another PR.