UNPKG

alsatian

Version:

TypeScript and JavaScript testing framework for beautiful and readable tests

21 lines 1.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); require("reflect-metadata"); const _metadata_keys_1 = require("./_metadata-keys"); const unused_1 = require("../unused"); const mark_property_as_test_1 = require("./mark-property-as-test"); const deprecate_1 = require("../maintenance/deprecate"); function AsyncTest(description) { return (target, propertyKey, descriptor) => { unused_1.Unused(descriptor); deprecate_1.deprecate("AsyncTest", "4.0.0", "Use the Test decorator instead."); mark_property_as_test_1.markPropertyAsTest(propertyKey, target); const tests = Reflect.getMetadata(_metadata_keys_1.TESTS, target); const testDefinition = tests.filter(test => test.key === propertyKey)[0]; testDefinition.isAsync = true; testDefinition.description = description; Reflect.defineMetadata(_metadata_keys_1.TESTS, tests, target); }; } exports.AsyncTest = AsyncTest; //# sourceMappingURL=async-test-decorator.js.map