Skip to content

testWidgets causes incorrect file/line/column for tests (returns location of the test() call inside flutter_test) #18195

Closed
@DanTup

Description

@DanTup

The test framework returns the location for a test so that an editor can jump to it when the user clicks on it. For tests that use testWidgets it returns the location of the test call inside testWidgets so it won't take the user to where they expect.

Example:

{
	"test": {
		"id": 3,
		"name": "Changing locale",
		"suiteID": 0,
		"groupIDs": [
			2
		],
		"line": 60,
		"column": 18,
		"url": "package:flutter_test/src/widget_tester.dart"
	},
	"type": "testStart",
	"time": 21952
}

I need to use this information to navigate to the test when a user clicks in the tree on the left. Currently I ignore any package: URIs so it just does nothing, but it makes the test runner much less useful.

screen shot 2018-06-05 at 10 42 33 am

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions