Skip to content

Two refactors with the same name are hard to test #18844

Closed
@ghost

Description

TypeScript Version: nightly (2.6.0-dev.20170929)

Code

/// <reference path='fourslash.ts' />

////function f() { /*a*/1/*b*/; }

goTo.select("a", "b");
edit.applyRefactor({
    refactorName: "?",
    actionName: "?",
    actionDescription: "?",
    newContent: "?",
});

Running this test with the change in #18843 prints:

     Error: At line 1, col 15: The expected refactor: ? is not available at the marker location.
Available refactors: Extract Symbol,Extract Symbol

Problem: The way applyRefactor in fourslash.ts is written, there's no way we can assert things about the second refactor, since we match them by name and we'll always find the first one first. (Also, this seems to uncover that we have no tests of it.)

Instead of making the test runner more complicated, we should probably have one refactor with multiple actions, or two refactors with different names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    InfrastructureIssue relates to TypeScript team infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions