I created a React Native project using the popular Ignite CLI v2.0.0 with the default template . Then I decorated it with a bunch of nodal spacers, because I will have some node dependencies. Everything works, and I can run Jest tests from the command line. So far so good.
However, now one of my unit tests is a timeout. This is probably due to the failure of the asynchronous call that calls the node function. But there is no information about the error, location, etc.
So, I want to debug using Visual Studio v1.13.1 , and here the problem begins. I canβt understand for the rest of my life how to configure this to set breakpoints both in tests and in application code + node_modules .
I installed React Native Tools v0.3.2 and can start the debugger using the default Debug Android configuration:
[vscode-react-native] Finished executing: adb -s emulator-5554 shell am broadcast -a "com.myexample.RELOAD_APP_ACTION" --ez jsproxy true [vscode-react-native] Starting debugger app worker. [vscode-react-native] Established a connection with the Proxy (Packager) to the React Native application [vscode-react-native] Debugger worker loaded runtime on port 13746 Running application "MyApplication" with appParams: {"rootTag":1}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF
But breakpoints do not fall. VS says: Breakpoint ignored because generated code not found (source map problem?). (btw: both index.android.bundle and index.android.map just been generated in .vscode/.react ). And also I see no way to debug test code (which lives in ${projectRoot}/Tests ).
Based on a large number of search queries, I created another debug configuration for running Jest in VS Code:
{ "type": "node", "request": "launch", "name": "Jest Tests", "program": "${workspaceRoot}/node_modules/jest-cli/bin/jest.js", "args": [ "--config", "package.json", "--runInBand", "--verbose", "--no-cache", "-u" ], "runtimeArgs": [ "--nolazy" ], "console": "internalConsole", "sourceMaps": true, "address": "localhost", "port": 8081, "outFiles": [ "${workspaceRoot}/.vscode/.react" ], "env": { "NODE_ENV": "test" } }
This at least runs the tests, showing the test report in the VS debugging console, but once again not a single breakpoint hits.
I also tried setting outFiles to the place where ignite generates the package, i.e. ${workspaceRoot}/android/app/build/intermediates/assets/debug/* with the same results.
Can someone point me in the right direction?
PS. I'm on Ubuntu 16.04:
System platform linux arch x64 cpu 4 cores Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz JavaScript node 8.1.2 /usr/local/bin/node npm 4.6.1 /usr/local/bin/npm yarn 0.24.6 /usr/bin/yarn React Native react-native-cli 2.0.1 app rn version 0.45.1 Ignite ignite 2.0.0 /usr/local/bin/ignite Android java 1.8.0_111 /usr/bin/java android home - undefined