I assumed I could use the regular node hooking to record test cases. But it was incorrect because jest re-implement its own module system. Rather, we should use the jest transformer api. This required some refactoring -- eg: for instance merging hook-esm and hook-cjs together. I also add some refactoring which was not strictly needed for this -- eg: merging all recorder components together. The actual fix is in the very last commit.
Maybe the most difficult part of this PR is the small step back I took for handling the user commands. I did this because the way node merges tokenized commands did not work for transformers. Also, I was not comfortable with my ad-hoc shell parsing. It was confusing for the user to understand which shell he could use. I think it is now easier to explain to the user and the code is definitely simpler even though configuration-accessor could use a refactoring.
I assumed I could use the regular node hooking to record test cases. But it was incorrect because jest re-implement its own module system. Rather, we should use the jest transformer api. This required some refactoring -- eg: for instance merging
hook-esm
andhook-cjs
together. I also add some refactoring which was not strictly needed for this -- eg: merging all recorder components together. The actual fix is in the very last commit.Maybe the most difficult part of this PR is the small step back I took for handling the user commands. I did this because the way node merges tokenized commands did not work for transformers. Also, I was not comfortable with my ad-hoc shell parsing. It was confusing for the user to understand which shell he could use. I think it is now easier to explain to the user and the code is definitely simpler even though
configuration-accessor
could use a refactoring.