"use strict";
require("reflect-metadata");
function Test(description) {
return function (target, propertyKey, descriptor) {
// check if this has been registered as a test already
var tests = Reflect.getMetadata("alsatian:tests", target);
// if there are no tests registered yet then register it
if (!tests) {
tests = [{
key: propertyKey
}];
}
else if (tests.filter(function (test) { return test.key === propertyKey; }).length === 0) {
tests.push({
key: propertyKey
});
}
// set the description
tests.filter(function (test) { return test.key === propertyKey; })[0].description = description;
// update the register
Reflect.defineMetadata("alsatian:tests", tests, target);
};
}
exports.Test = Test;
//# sourceMappingURL=test-decorator.js.map |