Replies: 3 comments
-
|
To solve the issue of input/ouput of the cli, I will test with running it in a child process. This will also fix the file system issue as we can just set a cwd for the child process and have the scripts.ts file stored in there. So will need a utility function to do this but shouldn't be difficult. |
Beta Was this translation helpful? Give feedback.
-
|
Peeky seems to have issues with importing some modules, so I will probably use vitest. |
Beta Was this translation helpful? Give feedback.
-
|
Yup vitest is working nicely, started adding some basic tests |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a closed system, so in theory it should be simple to test. It just reads in a file -> parses it -> finds the function(s) to run -> and runs them. But the current implementation uses a lot of node apis to accomplish this, the inputs consist of the file system and command line argument. And the output is the terminal (both console.log and piping to stdout). This makes it complicated to test despite the deterministic aspect of it.
For testing I was going to reach to Vitest as its been a pleasure to use in the past. But during research I found Peeky and I am quite interested in using it instead.
Any suggests are greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions