js.lua 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. require("dap-vscode-js").setup({
  2. -- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node"
  3. -- debugger_path = "(runtimedir)/site/pack/packer/opt/vscode-js-debug", -- Path to vscode-js-debug installation.
  4. -- debugger_cmd = { "js-debug-adapter" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`.
  5. adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' }, -- which adapters to register in nvim-dap
  6. -- log_file_path = "(stdpath cache)/dap_vscode_js.log" -- Path for file logging
  7. -- log_file_level = false -- Logging level for output to file. Set to false to disable file logging.
  8. -- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output.
  9. })
  10. for _, language in ipairs({ "typescript", "javascript" }) do
  11. require("dap").configurations[language] = {
  12. {
  13. type = "pwa-node",
  14. request = "launch",
  15. name = "Debug Mocha Tests",
  16. -- trace = true, -- include debugger info
  17. runtimeExecutable = "node",
  18. runtimeArgs = {
  19. "./node_modules/mocha/bin/mocha.js",
  20. },
  21. rootPath = "${workspaceFolder}",
  22. cwd = "${workspaceFolder}",
  23. console = "integratedTerminal",
  24. internalConsoleOptions = "neverOpen",
  25. },
  26. {
  27. type = "pwa-node",
  28. request = "launch",
  29. name = "Debug WebdriverIO Tests",
  30. -- trace = true, -- include debugger info
  31. runtimeExecutable = "node",
  32. runtimeArgs = {
  33. "./node_modules/@wdio/cli/bin/wdio.js",
  34. "./wdio.conf.ts",
  35. "--spec",
  36. "${file}",
  37. },
  38. rootPath = "${workspaceFolder}",
  39. cwd = "${workspaceFolder}",
  40. console = "integratedTerminal",
  41. internalConsoleOptions = "neverOpen",
  42. },
  43. }
  44. end