You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moved from flutter/flutter#131681. I thought this was just a request for dart-lang/test#1851, however looking at the JSON we do get the location of the tearDownAll method, but we seem to record the line/col from that event in the file.
Here, "Go to Test" on "(tearDownAll)" is navigating to line 33 of the left file, instead of the right one. The test I ran was on line 26 of the left file.
The test event looks like:
{"test": {"id": 5,"name": "(tearDownAll)","suiteID": 0,"groupIDs": [2],"metadata": {"skip": false,"skipReason": null},///////////////////////////////////////// 👇 This info looks correct "line": 33,"column": 3,"url": "file:///C:/Dev/Google/leak_tracker/pkgs/leak_tracker_flutter_test/test/tests/end_to_end/leak_tracking_config_test/flutter_test_config.dart"},"type": "testStart","time": 1072},
The text was updated successfully, but these errors were encountered:
Turns out this will only work in Flutter because of testExecutable because it allows the setUpAll and tearDownAll functions to be called without the test suite file in the stack.
If you trigger calling setUpAll() and tearDownAll() from inside the suite (as you'd need to without testExecutable) then package:test provides root locations that match the test file:
I think we can handle this by special-casing these methods and looking at line/col/url for these "tests", although we currently have to do that based on the names. The reason we don't normally use these fields is that if a user calls a test wrapper (like testWithWidgets) we do want the call back from the main suite.
We now treat setup/teardown specially and attribute them to their actual locations and not the call in the suite. This means a setup/teardown might be recorded against multiple suites in the tree - right-clicking on the icon will let you select which suite to jump to in the tree (seems VS Code already had good handling of this).
Moved from flutter/flutter#131681. I thought this was just a request for dart-lang/test#1851, however looking at the JSON we do get the location of the
tearDownAll
method, but we seem to record the line/col from that event in the file.Here, "Go to Test" on "(tearDownAll)" is navigating to line 33 of the left file, instead of the right one. The test I ran was on line 26 of the left file.
The test event looks like:
The text was updated successfully, but these errors were encountered: