obsidian-media-db-plugin icon indicating copy to clipboard operation
obsidian-media-db-plugin copied to clipboard

Write tests

Open mProjectsCode opened this issue 3 years ago • 12 comments

  • reintroduce the test api
  • write some automated tests

mProjectsCode avatar May 24 '22 09:05 mProjectsCode

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 avatar Jun 20 '22 21:06 AB1908

@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

mProjectsCode avatar Jun 21 '22 12:06 mProjectsCode

Sure, what time is comfortable for you?

AB1908 avatar Jun 21 '22 13:06 AB1908

@AB1908 Now?

mProjectsCode avatar Jun 21 '22 14:06 mProjectsCode

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.

AB1908 avatar Jul 03 '22 22:07 AB1908

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.

mProjectsCode avatar Jul 04 '22 08:07 mProjectsCode

I'll clean up and open a draft PR then.

AB1908 avatar Jul 04 '22 10:07 AB1908

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?

AB1908 avatar Sep 22 '22 13:09 AB1908

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.

mProjectsCode avatar Sep 22 '22 14:09 mProjectsCode

That sounds fantastic. Hit me up on Discord and we can arrange something.

AB1908 avatar Sep 22 '22 21:09 AB1908

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.

mProjectsCode avatar Sep 22 '22 22:09 mProjectsCode

Agreed! Didn't strike me at the time but I'll make sure I get to that.

AB1908 avatar Sep 23 '22 00:09 AB1908