IntelliJ doesn't save code changes before running tests
See original GitHub issueEnvironment info:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17763.557], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.4)
[√] IntelliJ IDEA Ultimate Edition (version 2019.1)
[√] VS Code (version 1.33.1)
Steps to reproduce problem:
- Create Flutter project
- Create
unit/calculator.dart
:
int calculate(int a) {
return a + 3;
}
- Create
unit/test.dart
import 'package:flutter_test/flutter_test.dart';
import 'calculator.dart';
void main() {
group('simple', () {
test('calculate', () {
final value = calculate(2);
expect(value, 5);
});
});
}
- Place breakpoint on the line with
expect
to see the value of the variablevalue
. - Run the program with
SHIFT + F10
This is the command executed:flutter\bin\flutter.bat --no-color test --machine test\unit\test.dart
- Change the added value in the calculator:
int calculate(int a) {
return a + 30;
}
-
Run debug with
SHIFT + F9
This is the command executed:flutter\bin\flutter.bat --no-color test --machine --start-paused test\unit\test.dart
-
Problem: Old value is shown, code did not compile again.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (1 by maintainers)
Top Results From Across the Web
IntelliJ doesn't save code changes before running tests
In my Run test using set in IntelliJ IDEA, IntelliJ doesn't save code changes before running tests. My Run tests using.
Read more >Save and revert changes | IntelliJ IDEA Documentation
In the Settings/Preferences dialog ( Ctrl+Alt+S ), select Tools | Actions on Save. Select the checkboxes next to the actions that you want...
Read more >Code change is not being reflected in the idea plugin
Hello, I am developing an Intellij plugin (tutorials) which shows the current git branch in the notification. Below are the steps I...
Read more >Run tests | IntelliJ IDEA Documentation - JetBrains
When you run a test, IntelliJ IDEA creates a temporary run configuration. You can save temporary run configurations, change their settings, ...
Read more >Intellij is not updating junit test file changes causing unreliable ...
Try re-creating project configuratoin by re-importing project from existing sources: https://www.jetbrains.com/help/idea/import-project-or- ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I tested and verified the same behavior. I did this by doing a
watch -d -n 1 cat my_file_test.dart
in an external terminal window and running tests. I simply would add some nonsense that wouldn’t compile and ran the test without switching windows and it would compile successfully. The watch showed no changes. As soon as I clicked outside of IntelliJ (clicking the internal terminal didn’t work for me) then the watch updated and the tests would no longer compile. Good catch, @andrasferenczi!@TahaTesser I would say this describes the way I was trying to reproduce the issue on the command line and I am getting exactly the same thing as you did for the output