25 lines
377 B
JavaScript
25 lines
377 B
JavaScript
"use strict";
|
|
class Base {
|
|
set test(v) {
|
|
throw new Error("gobbledygook");
|
|
}
|
|
}
|
|
|
|
class Obj extends Base {
|
|
call() {
|
|
return super.test();
|
|
}
|
|
|
|
test() {
|
|
throw new Error("gobbledygook");
|
|
}
|
|
}
|
|
|
|
const obj = new Obj();
|
|
expect(() => {
|
|
obj.call();
|
|
|
|
// Assert that this throws, but that it's not
|
|
// a gobbledygook error that is thrown
|
|
}).toThrowError(TypeError)
|