suppose we have class A with a method called foo inside it. and we have a decorator function that is responsible for decorating method foo.
class A {
@decorate_foo
foo() {
}
}
function decorate_foo(target, name, descriptor) {
var fn = descriptor.value;
if (typeof fn == "function") {
descriptor.value = async function (...args) {
console.log(`parameters: ${args}`);
var result = fn.apply(this, args);
return result;
};
}
return descriptor;
}
so is it possible inside testing we ignore the decorator?