Consider the following scenario:
return function IsDefined(object: any, propertyName: string) {
....
]
We then go ahead and decorate a property like this:
class Test {
@IsDefined() p1: String = "";
}
Now, when we execute a test inside the decorator:
expect(object).to.equal(Test);
Should it succeed? What exactly is object
in this context?
Here's an example that successfully passes:
const instance:any = new Test();
expect(object.constructor.name).
to.equal(instance.constructor.name);