Debugging Unit tests with Atom (Vue application) - unit-testing

Is there a way to debug, via breakpoints, unit tests on a VueJS project?
I currently have the default Vue CLI setup and am using the official Vue plugin for Mocha-Webpack, as configured by the CLI. I am trying to figure out how to connect any of the debugger packages in Atom with the cli command that runs our unit tests.
The desired outcome is that I can add a breakpoint within Atom IDE and run 'vue-cli-service test:unit' and have it stop at each breakpoint so we can properly debug out unit tests. A nice to have would also be the ability to run individual tests as well with the ability to debug with breakpoints.
I have searched and have not been able to find anything. Out tests are running as expected but being able to debug them would be a huge help. Thanks!

Related

UWP unit testing with Jenkins

It is not really an issue I would like to ask today but I search best practices to unit testing a UWP application with Jenkins.
First, I created a Unit Test App for my main application and, on my development machine, I generated appx package using MSBuild command line tool. It works well and I can also execute unit tests with the VS Test console.
Then I tried to automate it with Jenkins on my build server. But the MSBuild command does not work. I have no issue but it produces no output. After lot of research (without any success), my question is the following:
What is the best way to make UWP unit testing with a result dashboard using Jenkins?
Thanks
In order to make MSBuild work correctly, I had to create two subsequent build steps, one with command line argument:
-t:restore
in order to make it restore all the nuget dependencies, and a second one with command line arguments:
/t:Rebuild /p:Configuration=Release
/p:UapAppxPackageBuildMode=StoreUpload
for the real release compilation and the creation of both sideload and storeUpload msix files

How to debug Meteor unit test in WebStorm?

I was following Meteor's Angular testing guide and it told me to run unit test by using this command:
meteor test --driver-package practicalmeteor:mocha
I'm using WebStorm to edit my Meteor code, so I want to know is there any way to run/debug unit test in WebStorm?
Running tests
You have to make a Run/Debug Configuration in Webstorm for Meteor.
You'll have to set the program arguments correctly:
test --driver-package practicalmeteor:mocha
You run the tests by running this configuration.
Debugging tests client-side
You can use the previous configuration and debug using the browser's console.
Debugging tests server-side
Make a new Meteor configuration with arguments:
test --driver-package practicalmeteor:mocha --debug-port 5858.
Running this configuration you'll see an output similar to:
W20170409-20:19:21.287(2)? (STDERR) Debugger listening on [::]:5959
You can then debug the code by browsing to: http://localhost:8080/debug?port=5959
Note: in my case the port in the console differs from the port in the configuration. I have to use that port in the url.

How to run Windows phone 8 & 8.1 Unit tests in jenkins [Visual studio 2013]

We use Jenkins as our CI, and im looking to have Jenkins run visual studio tests. Ive figured out how to have Jenkins use vstest.console.exe for desktop applications, but im not sure how to get that to work for windows phone 8.1 tests. I'm running vstest.console.exe against my unit test project's appx file, but im getting:
Error: App package ...appx does not has test executor entry point. For
running unit tests for Windows Store apps, create app package using
Windows Store app Unit Test Library project.
Any help getting the program to work thorugh command line would be of big help, but if there is a short cut to run it through jenkins that would be even better.
I found an answer to my problem. Make sure to use /InIsolation, and use /Settings:{settingsFile}. For some reason vstest.console.exe cant run the unit tests for windows phone without specifically setting a settingsfile. In jenkins/vsTestrunner there is an option to set the settings file. You will likley still get an error regarding running the test in non-interactive way on jenkins, but there are a few stackoverflow posts about this already.

How to get code coverage for java stand-alone application

I have one java standalone application for which I need to get code coverage report using JaCoCo.
I don't want to use Elipse to run the application as I have jar file.
How to configure JaCoCo for standalone application without using eclipse.

Unable to execute unit tests in a maven project from within intellij

I have inherited a legacy project with 100s of tests, and dependencies defined within the pom.
All of the tests run when I execute a mvn clean install from the command line, but when I try to execute one of these tests in debug mode from within Intellij i get the following error.
java.lang.NoClassDefFoundError: Could not initialize class
How can I get intellij to recognise these dependencies when trying to run a test in debug mode from the ide?
I managed to solve this by simply changing the working directory location in the Run configuration to point to the correct classpath location. The default location had been taken from a parent project.
It would be very convenient if one was able to debug tests from within IntelliJ. I have run into similar issues with my massive project and have found a workaround for it.
When wishing to debug a test, I have often found it useful to use a remote debugging session like so:
mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE" -Dtest=com.autofunk.TheFunkImplTest test -DfailIfNoTests=false
You can then attach to the above using a remote debug session from within IntelliJ on port 8000.
Therefore, when debugging tests I first check to see whether a simple debug from within Intellij works. If not, I run the above and then attach to it using a debug configuration like so:
IntelliJ execute unit tests without mvn command.
a IntelliJ plugin: MvnRunner
You can run tests using the maven project window in IntelliJ
View - Tool Windows - Maven Projects
Then under the project or module you wish to test open the lifecycle goals and click test.
This will run the currently configured test goal. Now the report is logged into the target directory
I use
https://github.com/destin/maven-test-support-plugin
to view the test results.
You can access this screen once the plugin is installed from the Project window again right click on the projects root and select "Show Test Results" (should be below the maven icon)
Good luck