Skip to content

Some test in reference.ts seems to not actually be testing anything #9731

@timotheeguerin

Description

@timotheeguerin

As part of upgrading dependency(#9730) in included eslint 10 which added a new rule which seems to have found a few bugs and dead code. There is those tests that seems to be not actually testing anything

packages/compiler/test/checker/references.test.ts

describe("reference sibling members", () => {
      // Those tests look broken 
      // eslint-disable-next-line no-unassigned-vars
      let linkedValue: Operation | undefined;


it("defined before", async () => {
        testHost.addTypeSpecFile(
          "main.tsp",
          `
        import "./test-link.js";
        @test interface Foo {
          one(): void;
          @testLink(Foo.one)
          two(): void;
        }
      `,
        );

        const { Foo } = (await testHost.compile("./main.tsp")) as {
          Foo: Interface;
        };
        strictEqual(linkedValue, Foo.operations.get("a"));
      });

linkedvalue is never set and operations.get("a") doesn't exists either

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions