UNPKG

2.94 kBTypeScriptView Raw
1import { IRawProperty } from '../property/IRawProperty';
2import { Parameters } from './configuration/Parameters';
3import { RunDetails } from './reporter/RunDetails';
4import { IAsyncProperty } from '../property/AsyncProperty';
5import { IProperty } from '../property/Property';
6/**
7 * Run the property, do not throw contrary to {@link assert}
8 *
9 * WARNING: Has to be awaited
10 *
11 * @param property - Asynchronous property to be checked
12 * @param params - Optional parameters to customize the execution
13 *
14 * @returns Test status and other useful details
15 *
16 * @remarks Since 0.0.7
17 * @public
18 */
19declare function check<Ts>(property: IAsyncProperty<Ts>, params?: Parameters<Ts>): Promise<RunDetails<Ts>>;
20/**
21 * Run the property, do not throw contrary to {@link assert}
22 *
23 * @param property - Synchronous property to be checked
24 * @param params - Optional parameters to customize the execution
25 *
26 * @returns Test status and other useful details
27 *
28 * @remarks Since 0.0.1
29 * @public
30 */
31declare function check<Ts>(property: IProperty<Ts>, params?: Parameters<Ts>): RunDetails<Ts>;
32/**
33 * Run the property, do not throw contrary to {@link assert}
34 *
35 * WARNING: Has to be awaited if the property is asynchronous
36 *
37 * @param property - Property to be checked
38 * @param params - Optional parameters to customize the execution
39 *
40 * @returns Test status and other useful details
41 *
42 * @remarks Since 0.0.7
43 * @public
44 */
45declare function check<Ts>(property: IRawProperty<Ts>, params?: Parameters<Ts>): Promise<RunDetails<Ts>> | RunDetails<Ts>;
46/**
47 * Run the property, throw in case of failure
48 *
49 * It can be called directly from describe/it blocks of Mocha.
50 * It does not return anything in case of success.
51 *
52 * WARNING: Has to be awaited
53 *
54 * @param property - Asynchronous property to be checked
55 * @param params - Optional parameters to customize the execution
56 *
57 * @remarks Since 0.0.7
58 * @public
59 */
60declare function assert<Ts>(property: IAsyncProperty<Ts>, params?: Parameters<Ts>): Promise<void>;
61/**
62 * Run the property, throw in case of failure
63 *
64 * It can be called directly from describe/it blocks of Mocha.
65 * It does not return anything in case of success.
66 *
67 * @param property - Synchronous property to be checked
68 * @param params - Optional parameters to customize the execution
69 *
70 * @remarks Since 0.0.1
71 * @public
72 */
73declare function assert<Ts>(property: IProperty<Ts>, params?: Parameters<Ts>): void;
74/**
75 * Run the property, throw in case of failure
76 *
77 * It can be called directly from describe/it blocks of Mocha.
78 * It does not return anything in case of success.
79 *
80 * WARNING: Has to be awaited if the property is asynchronous
81 *
82 * @param property - Property to be checked
83 * @param params - Optional parameters to customize the execution
84 *
85 * @remarks Since 0.0.7
86 * @public
87 */
88declare function assert<Ts>(property: IRawProperty<Ts>, params?: Parameters<Ts>): Promise<void> | void;
89export { check, assert };