message: chore: Fix reference tests
diff: +import type * as ts from "typescript";
  import { deepStrictEqual as equal } from "assert";
  -import { ReflectionKind } from "../../../lib/models";
  +import { ProjectReflection, ReflectionKind } from "../../../lib/models";
  import { DeclarationReflection } from "../../../lib/models/reflections/declaration";
  import { ReferenceType } from "../../../lib/models/types/reference";
  describe("Reference Type", () => {
  describe("equals", () => {
  - it("types with same symbolFullyQualifiedName are equal", () => {
  - const type1 = new ReferenceType("Type", "Type");
  - const type2 = new ReferenceType("Type", "Type");
  + const fakeSymbol1 = (Symbol() as any) as ts.Symbol;
  + const fakeSymbol2 = (Symbol() as any) as ts.Symbol;
  + const project = new ProjectReflection("");
  - equal(type1.equals(type2), true);
  - });
  -
  - it("types with different symbolFullyQualifiedName are not equal", () => {
  - const type1 = new ReferenceType("Type1", "Type1");
  - const type2 = new ReferenceType("Type2", "Type2");
  -
  - equal(type1.equals(type2), false);
  - });
  -
  - it("types with different symbolFullyQualifiedName but same reflection are equal", () => {
  const reflection = new DeclarationReflection(
  "declaration",
  ReflectionKind.Function
  );
  - const type1 = new ReferenceType("Type1", "Type1", reflection);
  - const type2 = new ReferenceType("Type2", "Type2", reflection);
  + project.children ??= [];
  + project.children.push(reflection);
  + project.registerReflection(reflection, fakeSymbol1);
  +
  + it("types with same target are equal", () => {
  + const type1 = new ReferenceType("Type", fakeSymbol1, project);
  + const type2 = new ReferenceType("Type", fakeSymbol1, project);
  equal(type1.equals(type2), true);
  });
  - it("types with different symbolFullyQualifiedName but different reflection (one is undefined) are equal", () => {
  - const reflection = new DeclarationReflection(
  - "declaration",
  - ReflectionKind.Function
  - );
  - const type1 = new ReferenceType("Type1", "Type1", reflection);
  - const type2 = new ReferenceType("Type2", "Type2", undefined);
  + it("unresolved types with same target are equal", () => {
  + const type1 = new ReferenceType("Type", fakeSymbol2, project);
  + const type2 = new ReferenceType("Type", fakeSymbol2, project);
  +
  + equal(type1.equals(type2), true);
  + });
  +
  + it("types with different targets are not equal", () => {
  + const type1 = new ReferenceType("Type1", fakeSymbol1, project);
  + const type2 = new ReferenceType("Type2", fakeSymbol2, project);
  equal(type1.equals(type2), false);
  });
  +
  + it("types with same resolved target are equal", () => {
  + const type1 = new ReferenceType("Type1", reflection, project);
  + const type2 = new ReferenceType("Type2", fakeSymbol1, project);
  +
  + equal(type1.equals(type2), true);
  + });
  });
  });
  