Skip to content

mock set to null when interface and namespace have the same name #792

Description

@egriff38

Subject of the issue

When there is a namespace and an interface with the same name, with the namespace declared first, mocking that interface returns null.

Your environment

  • ts-auto-mock version: 3.2.2
  • typescript version: 4.3.2
  • node version: 14.3.0
  • npm version: 7.6.0
  • list any other dependencies that you think are relevant
    • though it is probably irrelevant to the example, I am using jest-ts-auto-mock v2.0.0

Steps to reproduce

import {createMock} from 'ts-auto-mock'
namespace B {}
interface B {
  b: string
}
console.log(createMock<B>())

Expected behavior

Should log {b: ""}

Actual behavior

Actually logs null

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions