-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Add Tests for Creating a New Project #249
base: main
Are you sure you want to change the base?
Conversation
Additionally adds a contract for the Directory interface. Creates an InMemoryFileSystem and FakeDirectory for use in unit tests. Tests InMemoryFileSystem to ensure it adheres to Directory contract. Todo: integration test for VaultDirectory to ensure contract is accurate.
-Enables use of Promise.allSettled
Isolates detection logic away from the obsidian API
- Move away from global use of stores
Give me a few days to find a good chunk of time to review this. Thanks for putting in all this effort! |
Take your time, I know you're busy with the new job 🙂 |
Hey @kevboh I know this one was a really big chunk to try to review. My thoughts on testing in obsidian have changed a little since then, and I'd be happy to try to take another stab at this (and break it into smaller bits for you). Let me know if you'd like me to give that a go, or if you're still thinking about reviewing this one :) |
I tried to keep this as small as possible, but I ended up creating a whole little ad-hoc integration test framework 😅
To summarize what's happening here:
VaultDirectory
) worked the way I expected, and that the mocked version I'm using in unit tests worked the same way, I created a contract test and, well, an integration test framework. This allows us to actually run tests within obsidian, but only when we actually run the specific build config. In the normal dev and prod build configurations, the tests won't be imported by anything, and thus not included.I recognize that this is still probably a lot to look over, so, if you'd prefer that I split this into two PRs: one for the int test framework stuff, and the other for actually adding the Create New Project unit tests, let me know :)