Skip to content
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

Write tests #11

Open
mProjectsCode opened this issue May 24, 2022 · 12 comments
Open

Write tests #11

mProjectsCode opened this issue May 24, 2022 · 12 comments
Assignees

Comments

@mProjectsCode
Copy link
Owner

  • reintroduce the test api
  • write some automated tests
@mProjectsCode mProjectsCode self-assigned this May 24, 2022
@AB1908
Copy link
Contributor

AB1908 commented Jun 20, 2022

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.

@mProjectsCode
Copy link
Owner Author

@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

@AB1908
Copy link
Contributor

AB1908 commented Jun 21, 2022

Sure, what time is comfortable for you?

@mProjectsCode
Copy link
Owner Author

@AB1908 Now?

@AB1908
Copy link
Contributor

AB1908 commented Jul 3, 2022

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.

@mProjectsCode
Copy link
Owner Author

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.

@AB1908
Copy link
Contributor

AB1908 commented Jul 4, 2022

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

@AB1908
Copy link
Contributor

AB1908 commented Sep 22, 2022

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?

@mProjectsCode
Copy link
Owner Author

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.

@AB1908
Copy link
Contributor

AB1908 commented Sep 22, 2022

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

@mProjectsCode
Copy link
Owner Author

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.

@AB1908
Copy link
Contributor

AB1908 commented Sep 23, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

2 participants