Nicolò Ribaudo ea6a438315
Enable external-helpers by default in tests (#12911)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Babel Bot <babel-bot@users.noreply.github.com>
2021-02-26 23:33:26 +01:00

36 lines
809 B
JavaScript

"use strict";
let Base = function Base() {
babelHelpers.classCallCheck(this, Base);
};
let Obj = /*#__PURE__*/function (_Base) {
babelHelpers.inherits(Obj, _Base);
var _super = babelHelpers.createSuper(Obj);
function Obj() {
babelHelpers.classCallCheck(this, Obj);
return _super.apply(this, arguments);
}
babelHelpers.createClass(Obj, [{
key: "call",
value: function call() {
return babelHelpers.get(babelHelpers.getPrototypeOf(Obj.prototype), "test", this).call(this);
}
}, {
key: "test",
value: function test() {
throw new Error("gobbledygook");
}
}]);
return Obj;
}(Base);
const obj = new Obj();
expect(() => {
obj.call(); // Assert that this throws, but that it's not
// Obj.p.test's error that is thrown
}).toThrowError(TypeError);