-
Notifications
You must be signed in to change notification settings - Fork 158
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
Fill "How to add automated tests to your plugin" page #754
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I have marked some things I noticed while reading through it.
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Show resolved
Hide resolved
|
||
```ts | ||
// myplugin.ts | ||
import { Notice } from "obsidian"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use explicit import type { Notice } from "obsidian";
notation. Adding "verbatimModuleSyntax": true,
to the TS config is a good idea anyways.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have a point, but I still would like to keep it this way. If one uses a obsidian dependency, i.e. Notice
, VSC creates an auto-import like this. While a type import would be cleaner, it is not necessary to use them to get the tests running and I'd like to only use and mention mandatory steps to keep the complexity lower.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is fair. Though without explicit type imports, you are at the mercy of whatever the TS transpiler in this setup does.
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
link obsidian example plugin github repository
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed a few more small things, mostly with the code examples around inconsistent code style.
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
Sorry for that, I should have invested 5 minutes to configure prettier in the example plugin after all .. :) If I might ask you to have a look again? Thanks for your time! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there XD
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
04 - Guides, Workflows, & Courses/Guides/How to add automated tests to your plugin.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Edited
Hello,
I created a guide how to integrate jest to the obsidian example plugin and how to deal with the obsidian API when running code in a test environment to fill in the stub page "How to add automated tests to your plugin".
I tested the guide via a Windows Sandbox but would very appreciate if somebody else undertakes the steps to make sure that it's working as expected.
I was unsure what to do with https://publish.obsidian.md/hub/04+-+Guides%2C+Workflows%2C+%26+Courses/Guides/How+to+test+plugin+code+that+uses+Obsidian+APIs and if I should update it, as well. I'd love your input here. "Issue 13" of the obsidian API is not available anymore and the links under "Other people's suggestions" are not reachable. However, I am not quite aware if the guide now provide enough guidance to remove the section altogether or what's the best course of action is.
If you have pointers to improve reading flow or wording, it'd be very appreciated. Furthermore I have no experience with Obsidian Publish and do not know if I should have avoided any kind of syntax - I only controlled the look and feel in Obsidian itself.
Also, since this is my first contribution, I hope it was correct to change the tag to "evergreen".
Regards
Added
Checklist
.md
extension