bloodyowl / rescript-test

A lightweight test framework for ReScript
https://bloodyowl.github.io/rescript-test/
MIT License
78 stars 9 forks source link

is there a watch mode? #12

Open vasco3 opened 1 year ago

claudebarde commented 1 year ago

I am looking for the same feature :) I could implement it myself with Nodemon, but if it was available out of the box, it would be super cool!

bloodyowl commented 1 year ago

hi!

there's no watch mode as the compiler emits a lot of these events.

a simple solution we could provide would be to provide a simple way to subscribe to the compiler saying "I'm done" through its websocket (like https://github.com/bloodyowl/rescript-react-starter-kit which triggers a webpack build on those events). would that work for you?

claudebarde commented 1 year ago

That would be a cool feature if it could be run directly from a script, but probably not worth it if you have to spend too much time on it :)

I just installed Nodemon and I use this command:

"res:watch_test": "nodemon --ext res --exec \"rescript clean -with-deps & rescript build & npm run res:test\""

(rescript clean -with-deps was necessary as a .bsb.lock file kept being created and messed with Nodemon)