UNPKG

1.07 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var after = require("lodash/after");
4var factory_1 = require("./factory");
5var applicators_1 = require("./applicators");
6var decorator = factory_1.DecoratorFactory.createDecorator(new factory_1.DecoratorConfig(after, new applicators_1.PostValueApplicator(), { setter: true }));
7/**
8 * The opposite of Before. This method creates a function that invokes once it's called n or more times.
9 * This spans across all instances of the class instead of the instance.
10 * @param {number} n The number of calls before the function is invoked.
11 * @example
12 *
13 * class MyClass {
14 * @AfterAll(2)
15 * fn() {
16 * return 10;
17 * }
18 * }
19 *
20 * const myClass = new MyClass();
21 * const myClass2 = new MyClass();
22 *
23 * myClass.fn(); // => undefined
24 * myClass.fn(); // => 10
25 *
26 * myClass2.fn(); // => 10
27 * myClass2.fn(); // => 10
28 */
29function AfterAll(n) {
30 return decorator(n);
31}
32exports.AfterAll = AfterAll;
33exports.afterAll = AfterAll;
34exports.default = decorator;
35//# sourceMappingURL=afterAll.js.map
\No newline at end of file