class Bar {} class Foo extends Bar { constructor() { if (eval("false")) super(); } } expect(() => new Foo()).toThrow("this hasn't been initialised");