Setting up Debug mocha tests #1306
Unanswered
swathisuja
asked this question in
Q&A
Replies: 1 comment
-
Hi, you can do that but when you need to call individual API the debug setup is a bit harder.. I will share with you example how you can do it. you will need to setup
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug UI Tests",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/extest",
"args": [
"run-tests",
"${workspaceFolder}/dist/test/*-test.js",
"--mocha_config",
"${workspaceFolder}/src/test/.mocharc-debug.js"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"preLaunchTask": "Install VSIX"
}
]
}
{
"version": "2.0.0",
"tasks": [
{
"label": "Get VS Code",
"type": "shell",
"command": ["${workspaceFolder}/node_modules/.bin/extest"],
"args": ["get-vscode"]
},
{
"label": "Get ChromeDriver",
"type": "shell",
"command": ["${workspaceFolder}/node_modules/.bin/extest"],
"args": ["get-chromedriver"],
"dependsOn": ["Get VS Code"]
},
{
"label": "Install VSIX",
"type": "shell",
"command": ["${workspaceFolder}/node_modules/.bin/extest"],
"args": ["install-vsix", "--vsix_file", "${workspaceFolder}/<DESIRED_EXTENSION_NAME>.vsix"],
"dependsOn": ["Get ChromeDriver"]
}
]
} then just need to execute added |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
HI Team,
As part of VS code extension testing, I have created one extension, added test set-up source file using Extester Test-Setup APIs. Since the target extension is different from source extension/project, I had to call individual APIs like Get Vscode, Get Chrome driver, Install VSIX (target extension) and Run tests in the setup file rather than using setupandrunttests API directly. Correct me if this is not ideal way to install target extension set up.
Setup file was created, Simple test files were added. To debug the test as per https://github.com/redhat-developer/vscode-extension-tester/wiki/Debugging-Tests
I have added configuration in launch.json file.
Need clarification on setting up debug configuration. Do I need to add individual configuration for each extest command like get-vscode, get-chromedriver, install-visx and run-tests and pass all options for each of the commands?
Like
Kindly Help to set up the debugging test feature .
Thanks,
Swathi.
Beta Was this translation helpful? Give feedback.
All reactions