obsidian-media-db-plugin
obsidian-media-db-plugin copied to clipboard
Write tests
- reintroduce the test api
- write some automated tests
Hey, if you give me some guidelines, I'd be happy to give it a stab. I've contributed absolutely nothing to this plugin so this would be a good start.
@AB1908 do you want to hop on a discord call?
I have some rough ideas for tests, but I think I can explain them better on a discord call than here on GitHub
Sure, what time is comfortable for you?
@AB1908 Now?
I've been chipping away at this slower than I had hoped to but it sure is tricky to mock APIs! Would you have any examples? It's also strangely unsatisfying to check logic and not add any features haha but I suppose I'll get a chance to do that once some sanity tests are in place.
I don't have any examples for you for mocking/testing APIs, but you can look at these tests that I wrote. https://github.com/mProjectsCode/obsidian-meta-bind-plugin/tree/master/tests
I can also create a test branch and you could open a PR to it so I can help you with that.
I'll clean up and open a draft PR then.
Wohoo! First round complete.
I'll look at where else testing would be useful and then maybe I'll finally start refactoring but meanwhile do you have any parts of the codebase in mind?
I am currently doing some heavy refactoring of main.ts and the modals myself.
Maybe we should jump on a discord call to discuss ideas and things that need to be done.
Then I can also share my plans for this plugin during obsidian October with you.
That sounds fantastic. Hit me up on Discord and we can arrange something.
I just saw that you added credits to fevol for the fetch mock in the commit message. We should also add it to the top of the file and the credits section in the readme.
Agreed! Didn't strike me at the time but I'll make sure I get to that.