close
  • English
  • includeTaskLocation

    • Type: boolean
    • Default: false
    • CLI: --includeTaskLocation

    Whether to include the location information of tests when collecting test information.

    When enabled, this configuration adds line and column number information to test cases and suites. This is useful for debugging and when reporters need to collect test information.

    Note that enabling this configuration may slightly decrease test execution performance.

    CLI
    rstest.config.ts
    npx rstest --includeTaskLocation

    Using with the list command

    The includeTaskLocation option is particularly useful when used with the list command, especially when you want to see the exact location of tests:

    npx rstest list --printLocation

    This will automatically enable includeTaskLocation and display the location information for each test case.

    Example output

    With includeTaskLocation enabled, reporters and the list command will include location information:

    {
      "testId": "test-1",
      "name": "should calculate correct sum",
      "testPath": "/path/to/test.spec.ts",
      "location": {
        "line": 15,
        "column": 3
      }
    }