Skip to content

stubConstructor does not stub base class methods #137

Description

@laleksiunas

Steps to reproduce:

  • Have a base class with a method named "foo"
  • Extend the base class and add a method named "bar"
  • Use stubConstructor to stub methods of the latter class

Code sample:

class A {
  foo() {
    return 'a';
  }
}

class B extends A {
  bar() {
    return 'b';
  }
}

const stubbedB = stubConstructor(B);

console.log(stubbedB.bar) // [Function: functionStub]
console.log(stubbedB.foo) // undefined

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions