jest-stub-super-constructor

Easily stub the super call from a constructor using jest

Usage no npm install needed!

<script type="module">
  import jestStubSuperConstructor from 'https://cdn.skypack.dev/jest-stub-super-constructor';
</script>

README

Actions Status Actions Status Actions Status Test Coverage Maintainability Packages npm version

Easily stub the super call from a constructor using jest

Usage

Just use it passing the class you want to stub the super on the constructor, like this:

  const superStub = stubSuperConstructor(MyClass);

And use the superStub the way you're used to, as with any other spy.

License

Licensed under MIT.