all files / core/decorators/ setup-decorator.ts

100% Statements 9/9
100% Branches 2/2
100% Functions 1/1
100% Lines 8/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17     54×   54× 12×     54×     54×    
import "reflect-metadata";
import { SETUP } from "./_metadata-keys";
 
export function Setup(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor<() => any>) {
 
    let setupFunctions: Array<string> = Reflect.getMetadata(SETUP, target);
 
    if (!setupFunctions) {
      setupFunctions = [];
    }
 
    setupFunctions.push(propertyKey);
 
    // mark as setup test method
    Reflect.defineMetadata(SETUP, setupFunctions, target);
};