class Bar {} class Foo extends Bar { constructor() { Foo[this]; } } expect(() => new Foo()).toThrow("this hasn't been initialised");