UNPKG

780 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3require("reflect-metadata");
4const _metadata_keys_1 = require("./_metadata-keys");
5function markPropertyAsTest(propertyKey, target) {
6 let tests = Reflect.getMetadata(_metadata_keys_1.TESTS, target);
7 if (!tests) {
8 tests = [
9 {
10 key: propertyKey
11 }
12 ];
13 Reflect.defineMetadata(_metadata_keys_1.TESTS, tests, target);
14 }
15 else if (tests.filter(test => test.key === propertyKey).length === 0) {
16 tests.push({
17 key: propertyKey
18 });
19 Reflect.defineMetadata(_metadata_keys_1.TESTS, tests, target);
20 }
21}
22exports.markPropertyAsTest = markPropertyAsTest;
23//# sourceMappingURL=mark-property-as-test.js.map
\No newline at end of file