Hacker News new | ask | show | jobs
by korkybuchek 612 days ago
Are there any tests for this library? And it looks like you don't support Typescript, is that planned?
2 comments

No tests yet, that's been on my list since the beginning and I now have the incentive to work on them:

https://github.com/jaysylvester/citizen/issues/24

I don't use TypeScript myself, but based on what I know, I don't think it would be difficult to add support. I just opened an issue to track it:

https://github.com/jaysylvester/citizen/issues/131

"No tests yet, been on my list." This truly is fitting within classic software norms. Bravo.
At least I stopped deploying site updates via FTP.
Question: would you expect it (or want it) to use a runner or a transpiler? Or does it not matter?
Couple of angles to this:

- I'd expect to be able to write typescript and have HMR work (which is not trivial)

- I'd expect a watch mode for my _own_ tests as well, also in TS

I think the first request isn't all that bad. Something like:

1. Transpile .ts modules to .js on app startup (development mode only)

2. Import .js modules into citizen as it does today

3. Watch for updates to .ts files and transpile to .js

4. Watch for updates to .js files and reload the module as it does today

I'm assuming you wouldn't want the transpiled JS modules sitting alongside their TS sources due to cleanliness, so I'd have to figure that part out.

The second request, no idea, since I've never written a test in my life :)