getappmap / appmap-agent-js

This project is deprecated. Please use https://github.com/getappmap/appmap-node/ to record Node.js applications.
Other
28 stars 8 forks source link

Fix jest instrumentation #175

Closed lachrist closed 1 year ago

lachrist commented 1 year ago

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.

appland-release commented 1 year ago

:tada: This PR is included in version 13.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: