You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
I am in the process of hacking the Google Calendar extension to support a custom formatter, and as part of my experimental work, I want to write some tests to limit the extent of the destruction I'd be causing 💥 . This being my first exposure to TS, Jest, and the whole JS dev ecosystem (I come from a world of C++ and python) means I am getting stuck every two steps, but that is to be expected :)
Anyway, I have seen that this repo contains a test and it runs! 😅 but when I have tried to extract the minimal elements that will allow me to run a test on the Gcal extension I have not been successful (yet). This is the motivator for this request. It would be of great help if the init command, together with the other files it generates, could also output a test file and the appropriate config that will make it run.
Some of my ideas around it:
It should import something from the main script, even if dummy
There should be a test in the test file
The test should fail by default (to encourage devs to actually touch the tests)
This should be the default behaviour, but there should be a flag to disable it, e.g. init --no-test
I'm creating this issue to see if you like the idea. I'm happy to contribute the changes if you do. When I figure out how to get that dummy test to run, that is.
The text was updated successfully, but these errors were encountered:
The only point here where I feel contention is number 4. I have some opinions on tests, one of which is a fear of it slowing down development from getting off the ground, which the init command is meant to shorten as much as possible.
I think I'd prefer this being an add-on option, --with-tests or --tests
There's a second concern that came up after I hit enter which is with point 1. Roam extensions don't need to export anything bc they just run in Roam on load. Importing something from the main script means we are now exporting something from the main script when we previously didn't need to, which is the start of writing source code just for the sake of tests. The default should probably be a separate file that exports something that is imported by the main file and the test
Fair points, and perhaps the desired outcome is to actually not do this at all. If not something that you want to introduce as the main experience, it could be something to live in docs, or a blog post somewhere. In the meantime, I'll try to make at least one test work.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am in the process of hacking the Google Calendar extension to support a custom formatter, and as part of my experimental work, I want to write some tests to limit the extent of the destruction I'd be causing 💥 . This being my first exposure to TS, Jest, and the whole JS dev ecosystem (I come from a world of C++ and python) means I am getting stuck every two steps, but that is to be expected :)
Anyway, I have seen that this repo contains a test and it runs! 😅 but when I have tried to extract the minimal elements that will allow me to run a test on the Gcal extension I have not been successful (yet). This is the motivator for this request. It would be of great help if the
init
command, together with the other files it generates, could also output a test file and the appropriate config that will make it run.Some of my ideas around it:
init --no-test
I'm creating this issue to see if you like the idea. I'm happy to contribute the changes if you do. When I figure out how to get that dummy test to run, that is.
The text was updated successfully, but these errors were encountered: