andrewbrereton / obsidian-to-ical-plugin

This is a plugin for Obsidian that searches your vault for tasks that contain dates, and generates a calendar in iCal format that can be imported into your preferred calendar application.
MIT License
61 stars 13 forks source link

Test test test #52

Closed andrewbrereton closed 8 months ago

andrewbrereton commented 8 months ago

I develop this plugin inside a vault that has Markdown files containing all types of tasks. While testing a feature, I will run the plugin and manually check that the output matches my expectations.

Improvements I want to make:

  1. Add this test vault to the source code,
  2. Symlink the plugin into the vault so that the plugin is at the root and the test vault is in a child directory. This means I can still open the vault in Obsidian and it will load the plugin in my development environment,
  3. Create a way to unit test the logic so that a given line generates the expected VEVENT/VTODO iCalendar block,
  4. Write a suite of unit tests to test all functionality and configurations programmatically,
  5. Add a package script for bun run test, and
  6. Add bun run test to the release workflow.
Blondwolf commented 8 months ago

Found this as official docs for Obsidian mentioning Jest

More globally for tests development, you could give a look at Jenkins + git CI/CD for automatisation. Idea is to launch tests on git push. If you are familiar with docker that could be also a way maybe.

andrewbrereton commented 8 months ago

Thanks @Blondwolf. I am very familiar with Jest, Jenkins and GitHub Actions. Jest would be my first choice. Jenkins is unnecessary in this scenario, it can all be done within a GitHub Actions workflow.

Blondwolf commented 8 months ago

You are welcome.

Sorry I was just spitting knowledge. This wasn't very constructive. I come more from PHP or C# environment so not so use to Typescript. My knowledge is limited.

andrewbrereton commented 8 months ago

Oh that's interesting. I have been working mostly with PHP and C# for about 20 years. I have a lot of experience with Javascript but only a little bit with Typescript. It is very easy to work with because it is quite similar to Javascript blended with modern PHP or C# (types, interfaces, enums, generics, namespaces, access modifiers, decorators, etc).

Blondwolf commented 8 months ago

Oh, I thought you were less experienced xD You were so humble you tricked me. You have more experience than me in fact.

This is personal matters but I've never really loved javascript because of security matters. And well... "undefined" and so hidden errors that made me mad by the past. I prefer strong type language so I avoid searching for 2 hours for my dumb error.

andrewbrereton commented 8 months ago

The more I learn, the more I realise how much I don't know!

I think you would enjoy Typescript then!

Blondwolf commented 8 months ago

The more I learn, the more I realise how much I don't know!

Wise words