IntelliJ Idea Community Edition - how to run all Dart unit tests in a project - intellij-idea

If I right click in a test file I can choose to run it. How do I run all the tests in my dart project within IntelliJ.
In VSCode an action exists that scans the project for files labelled _test.dart, is this VSCode / plugin specific or is it possible to do this in Intellij?

In Dart Test run configuration, you can set Test Mode to All in Folder to run all files that end with _test.dart in specified directory (similar to running pub run test path/to/dir in terminal):

Related

gradlew clean deployNodes - QUASAR WARNING: Quasar Java Agent isn't running

When I run "gradlew clean deployNodes" or "gradlew deployNodes", I get a warning on Quasar library:
QUASAR WARNING: Quasar Java Agent isn't running. If you're using another instrumentation method you can ignore this message; otherwise, please refer to the Getting
Started section in the Quasar documentation.
How can i fix this warning ?
I upgraded Corda to 4.1
you'll want to double-check the intellij settings.
Navigate to Build, Execution, Deployment -> Build Tools -> Gradle ->
Runner (or search for runner) Windows: this is in "Settings" MacOS:
this is in "Preferences" Set "Delegate IDE build/run actions to
gradle" to true Set "Run test using:" to "Gradle Test Runner" If you
would prefer to use the built in IntelliJ JUnit test runner, you can
run gradlew installQuasar which will copy your quasar JAR file to the
lib directory. You will then need to specify -javaagent:lib/quasar.jar
and set the run directory to the project root directory for each test.
As mentioned in the comments from manish, make sure to try cleaning the gradle cache as well: ./gradlew clean build deployNodes.
Joel has a good answer for a similar quasar issue on this StackOverflow question: Error when running Corda flow tests from IntelliJ

How do I make IntelliJ create Mocha debug configs when running unit tests?

When I create a new Mocha test file I am presented with the expected green gutter icons (▶ and ▶▶) to run each test or the suite. When I select "Run [test name]" I expect it to create a Mocha debug configuration and run it. Instead, IntelliJ creates a NodeJS run configuration, which understandably explodes in a shower of bit-flavored WTF.
If I manually create a configuration for the whole file, everything works as expected, including individual tests afterward. I am hoping that there is a setting somewhere that I have overlooked, something like "Settings -> ... -> Default Debug Configuration".
Does anyone know how I can make IntelliJ default to Mocha when a unit test is executed?
The logic used for determining what test runner is available for a given test file is based on dependencies declarations in package.json nearest to current file. Do you have 'mocha' listed as a dependency/dev dependency in your package.json? How many package.json files do you have in your project?
Note that, if Mocha is not installed locally/included in package.json, you can create a Mocha run configuration with "All in directory" selected and specify a directory where your spec files are located. In this case, clicking the gutter button in a test file inside this directory will suggest to run test with Mocha.
Note also that if you have created Node.js Run configuration with "JavaScript file" set to your mocha test file, IDEA will suggest using this configuration instead of Mocha when clicking on your tests, because explicitly created run configurations associated with current file have priority over the ones auto-generated from context. Deleting the configuration should solve the issue.

Intellij and sbt: How to make intellij to read custom configuration file for my play application tests?

For my test (Play Framework 2.6 app) I want to use different configuration file.
For this, I've added the following line into build.sbt
javaOptions in Test += "-Dconfig.file=conf/application.test.conf"
When I run tests from sbt (sbt test), it works fine, reads the custom configuration file.
But when running tests from IntelliJ IDEA, it ignores this setting and uses application.conf file.
How to force IntelliJ to use this sbt setting?
You have to edit your intellij configurations.
To do that use this : https://www.jetbrains.com/help/idea/creating-and-editing-run-debug-configurations.html.
Once you're in the edit configurations page, add ScalaTest into the list of your configurations. Then add -Dconfig.file=conf/application.test.conf under VM Parameters.
Save, and done!

IntelliJ 14 Gradle task in Test Runner

Upgraded to IntelliJ 14.0.1 One of the big new features I was looking for:
"If you run tests via a Gradle task, the IDE offers you the standard Test Runner instead of the console output." (Source: https://www.jetbrains.com/idea/whatsnew/#buildTools)
I right click on the Gradle Task to run our Integration Tests:
However, I see the results of the test still going to console output, not to the Test Runner:
Has anyone been able to get this new feature in IntelliJ IDEA 14 to work?
Thank you in advance,
Philip
Looks like IntelliJ looks for a task named "test" rather than a task of type Test.
https://github.com/JetBrains/intellij-community/blob/master/plugins/gradle/src/org/jetbrains/plugins/gradle/execution/test/runner/GradleTestsExecutionConsoleManager.java#L191
Rename the test task to unitTest and then create a wrapper that runs both:
// Rename test to unitTest
tasks.test.name = "unitTest"
// Wrap and run both
task test(dependsOn:['unitTest', 'integrationTest'])
If you only want to run integration tests, just overwrite it:
task test(overwrite: true, dependsOn: ['integrationTest'])
This allows me to run the integration tests in the test runner successfully (at least it works in IDEA 15 EAP but it should work in 14 as well I would think).
I still get this in IntelliJ 2017.1, but specifically when running tests in the gradle buildSrc directory. After digging a while, it turns out that the Gradle API doesn’t expose the test tasks in the special buildSrc directory to Intellij, so IntelliJ doesn’t recognize it as a test.
Workaround: Open another IntellIJ project for the buildSrc directory directory instead of trying to run tests cleanly inside the root project.

IntelliJ IDEA 11.1.2 does not copy SQL files to the out folder

I am using IntelliJ IDEA 11.1.2 Ultimate with Gradle 1.0 multi module project. One module represents the domain.
The projects output is points to [project-root]\out. But if I run a unit test the output folder of the domain module does not contain any .sql files at all. . This is how I run the JUnit test within IntelliJ IDEA .
If I run the project using Gradle from command line everything works fine.
Settings | Compiler | Resource Patterns, add the pattern for the sql extension.