Rstest provides a debug mode to troubleshoot problems, you can add the DEBUG=rstest
environment variable when building to enable Rstest's debug mode.
In debug mode, Rstest will:
verbose
In debug mode, Rstest will automatically generate dist/.rsbuild/rstest.config.mjs
file, which contains the final generated Rstest config. In this file, you can know the final result of the Rstest config you passed in after being processed by the framework and Rstest.
The content of the file is as follows:
For a complete introduction to Rstest config, please see the Configure Rstest chapter.
Rstest supports debugging in VS Code using debugger
statements or breakpoints. Just open the JavaScript Debug Terminal
and run the test command in the terminal.
You can also add a dedicated launch configuration to debug a test file in VS Code:
Then you can start debugging the current test file directly in VS Code by pressing F5
or go to the Run and Debug
panel.