burnstony#1975
burnstony#197511mo ago

vscode breakpoint

trying to debug following the instructions here https://docs.convex.dev/functions/testing in vscode the break points only work when I run 'npm run test' from a JavaScript debug terminal, and than only the breakpoints in the test file work. The breakpoints for the convex backend files don't work
Testing | Convex Developer Hub
Automating the testing of your Convex functions is easy.
7 Replies
ballingt
ballingt11mo ago
Can you step into the code to get to the Convex functions?
burnstony#1975
burnstony#1975OP11mo ago
I'll have to get back to you about this, started working on something else I can step in, but it goes into mutation, not my function await t.mutation(api.addPodcast.addPodcast, { name: "hi
ballingt
ballingt11mo ago
You might open an issue at https://github.com/get-convex/convex-test since this does sound useful
GitHub
GitHub - get-convex/convex-test: Testing harness for pure-JS Convex...
Testing harness for pure-JS Convex tests. Contribute to get-convex/convex-test development by creating an account on GitHub.
Michal Srb
Michal Srb11mo ago
A similar report is here in last comment: https://github.com/microsoft/vscode-js-debug/issues/1510
GitHub
Possible race condition in source mapping / breakpoint binding wit...
EDIT: I have a simpler way to trigger this behaviour, see following comment I have a breakpoint inside dynamically import()ed code that sometimes works. I can reliably make it work, or not, by enab...
Michal Srb
Michal Srb11mo ago
(We use dynamic imports because of the use of function references. So this appears to be one more downside of it - the first being that the tests don't rerun when the dynamically imported file is changed - which also feels fixable in Vitest)
ballingt
ballingt11mo ago
GitHub
Allow stepping into functions with the VSCode debugger · Issue #5 ·...
Michal says if we didn't dynamically import functions maybe we could step into them. (if I understand right) We could codegen an api-like object that has all the functions attached, or we could...
burnstony#1975
burnstony#1975OP11mo ago
very interesting - hopefully for now I am back to figuring out basic react stuff

Did you find this page helpful?