Skip to content

Commit

Permalink
Add section explaining how to run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwannheden committed Sep 25, 2024
1 parent 60b0a00 commit 6fc7319
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .run/RemotingServer.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="RemotingServer" type="Application" factoryName="Application">
<option name="ALTERNATIVE_JRE_PATH" value="17" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="true" />
<option name="MAIN_CLASS_NAME" value="org.openrewrite.remote.java.RemotingServer" />
<module name="rewrite-javascript.test" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>
9 changes: 9 additions & 0 deletions openrewrite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,12 @@ To be able to make changes to both these projects and make sure that they work t
1. For `openrewrite/rewrite-javascript` run `npm link @openrewrite/rewrite-remote`
2. For `moderneinc/rewrite-remote` run `npm link @openrewrite/rewrite`
4. Now you are basically all set. As the tests read the production source files from `dist` instead of `src` it is recommended to have `tsc --watch` running which you can do using `npm run dev`

For development it is recommended to open the `openrewrite` subdirectory as a project in WebStorm.

## Running Tests

The parser tests typically use LST remoting to print the LST back to text in order to verify the print idempotence.
In order to get this working the Java remoting server must already be running.
Start the Java remoting server directly from IntelliJ IDEA (`rewrite-javascript` repo) by running the shared `RemotingServer` configuration.
Now it should be possible to run the Jest tests from the terminal or from the WebStorm IDE.

0 comments on commit 6fc7319

Please sign in to comment.