News for hackers. Stuff that matters.

devrafx

Yeah, I've been thinking that would be nice to create a folder that holds all the json with the data mocked once using your interfaces as reference, that way could be used for unit testing.

Ask HN: Would be good to create a NPM package that creates mocks from TS source?

What I mean is, if you guys see any good in a Unit testing tool that helps with the creation of mock data using your project's interfaces/types as source and expose certains functions that brings the mocked object easily to behave whatever you want.The package would be based on this tool I've created https://butlermock.online/, thx. :)

( Read More... | 2 comments | on HN )
If you are that fast, just check the main.js in the src folder, there you will see the query params it just a GET :)

When running, just go to the '/api' endpoint.

I made it, but I have to document that API: avartation-api.vercel.app/api

The code source: https://github.com/Devrax/avartation-api

Re:How to TypeScript to JSON with Butlermock on Saturday August 19, 2023 @07:58PM (#37194616)
A tool for building mocks from typescript's types/interfaces into object with actual data provided by Fakerjs