All files / testing / bdd.ts

100.00% Branches 0/0
100.00% Lines 45/45
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
x1
x1
 
x1
x1
x1
 
x1
x1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
x1
x1
x1
 
x1
x1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
x1
x1
x1
 
x1
x1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
x1
x1
x1
 
x1
x1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
x1
x1
x1
 
x1
x1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
x1
x1
x1
 
x1
x1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
x1
x1
x1
 
x1
x1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
x1
x1
x1
 
 
 
 
 
 
 
 
x1
x1
 
x1
x1
x1










































































































































































































































import type { DescribeDefinition as _interface_DescribeDefinition } from "jsr:@std/[email protected]/bdd"
/**
 * The options for creating a test suite with the describe function.
 */
interface DescribeDefinition<T> extends _interface_DescribeDefinition<T> {}
export type { DescribeDefinition }

import type { ItDefinition as _interface_ItDefinition } from "jsr:@std/[email protected]/bdd"
/**
 * The options for creating an individual test case with the it function.
 */
interface ItDefinition<T> extends _interface_ItDefinition<T> {}
export type { ItDefinition }

import type { TestSuite as _interface_TestSuite } from "jsr:@std/[email protected]/bdd"
/**
 * A group of tests.
 */
interface TestSuite<T> extends _interface_TestSuite<T> {}
export type { TestSuite }

import type { ItArgs as _typeAlias_ItArgs } from "jsr:@std/[email protected]/bdd"
/**
 * The arguments for an ItFunction.
 */
type ItArgs<T> = _typeAlias_ItArgs<T>
export type { ItArgs }

import { it as _namespace_it } from "jsr:@std/[email protected]/bdd"
/**
 * Additional properties on the `it` function.
 */
const it = _namespace_it as typeof _namespace_it
export { it }

import { test as _function_test } from "jsr:@std/[email protected]/bdd"
/**
 * Alias of {@linkcode it}
 *
 * Registers an individual test case.
 *
 * @example Usage
 * ```ts
 * import { test } from "@std/testing/bdd";
 * import { assertEquals } from "@std/assert";
 *
 * test("a test case", () => {
 *   // test case
 *   assertEquals(2 + 2, 4);
 * });
 * ```
 *
 * @template T The self type of the function to implement the test case
 * @param args The test case
 */
const test = _function_test as typeof _function_test
export { test }

import { beforeAll as _function_beforeAll } from "jsr:@std/[email protected]/bdd"
/**
 * Run some shared setup before all of the tests in the suite.
 *
 * @example Usage
 * ```ts
 * import { describe, it, beforeAll } from "@std/testing/bdd";
 * import { assertEquals } from "@std/assert";
 *
 * beforeAll(() => {
 *  console.log("beforeAll");
 * });
 *
 * describe("example", () => {
 *   it("should pass", () => {
 *     // test case
 *     assertEquals(2 + 2, 4);
 *   });
 * });
 * ```
 *
 * @template T The self type of the function
 * @param fn The function to implement the setup behavior.
 */
const beforeAll = _function_beforeAll as typeof _function_beforeAll
export { beforeAll }

import { before as _function_before } from "jsr:@std/[email protected]/bdd"
/**
 * Alias of {@linkcode beforeAll}
 *
 * Run some shared setup before all of the tests in the suite.
 *
 * @example Usage
 * ```ts
 * import { describe, it, before } from "@std/testing/bdd";
 * import { assertEquals } from "@std/assert";
 *
 * before(() => {
 *  console.log("before");
 * });
 *
 * describe("example", () => {
 *   it("should pass", () => {
 *     // test case
 *     assertEquals(2 + 2, 4);
 *   });
 * });
 * ```
 *
 * @template T The self type of the function
 * @param fn The function to implement the setup behavior.
 */
const before = _function_before as typeof _function_before
export { before }

import { afterAll as _function_afterAll } from "jsr:@std/[email protected]/bdd"
/**
 * Run some shared teardown after all of the tests in the suite.
 *
 * @example Usage
 * ```ts
 * import { describe, it, afterAll } from "@std/testing/bdd";
 * import { assertEquals } from "@std/assert";
 *
 * afterAll(() => {
 *  console.log("afterAll");
 * });
 *
 * describe("example", () => {
 *   it("should pass", () => {
 *     // test case
 *     assertEquals(2 + 2, 4);
 *   });
 * });
 * ```
 *
 * @template T The self type of the function
 * @param fn The function to implement the teardown behavior.
 */
const afterAll = _function_afterAll as typeof _function_afterAll
export { afterAll }

import { after as _function_after } from "jsr:@std/[email protected]/bdd"
/**
 * Alias of {@linkcode afterAll}.
 *
 * Run some shared teardown after all of the tests in the suite.
 *
 * @example Usage
 * ```ts
 * import { describe, it, after } from "@std/testing/bdd";
 * import { assertEquals } from "@std/assert";
 *
 * after(() => {
 *  console.log("after");
 * });
 *
 * describe("example", () => {
 *   it("should pass", () => {
 *     // test case
 *     assertEquals(2 + 2, 4);
 *   });
 * });
 * ```
 *
 * @template T The self type of the function
 * @param fn The function to implement the teardown behavior.
 */
const after = _function_after as typeof _function_after
export { after }

import { beforeEach as _function_beforeEach } from "jsr:@std/[email protected]/bdd"
/**
 * Run some shared setup before each test in the suite.
 *
 * @example Usage
 * ```ts
 * import { describe, it, beforeEach } from "@std/testing/bdd";
 * import { assertEquals } from "@std/assert";
 *
 * beforeEach(() => {
 *  console.log("beforeEach");
 * });
 *
 * describe("example", () => {
 *   it("should pass", () => {
 *     // test case
 *     assertEquals(2 + 2, 4);
 *   });
 * });
 * ```
 *
 * @template T The self type of the function
 * @param fn The function to implement the shared setup behavior
 */
const beforeEach = _function_beforeEach as typeof _function_beforeEach
export { beforeEach }

import { afterEach as _function_afterEach } from "jsr:@std/[email protected]/bdd"
/**
 * Run some shared teardown after each test in the suite.
 *
 * @example Usage
 * ```ts
 * import { describe, it, afterEach } from "@std/testing/bdd";
 * import { assertEquals } from "@std/assert";
 *
 * afterEach(() => {
 *  console.log("afterEach");
 * });
 *
 * describe("example", () => {
 *   it("should pass", () => {
 *     // test case
 *     assertEquals(2 + 2, 4);
 *   });
 * });
 * ```
 *
 * @template T The self type of the function
 * @param fn The function to implement the shared teardown behavior
 */
const afterEach = _function_afterEach as typeof _function_afterEach
export { afterEach }

import type { DescribeArgs as _typeAlias_DescribeArgs } from "jsr:@std/[email protected]/bdd"
/**
 * The arguments for a DescribeFunction.
 */
type DescribeArgs<T> = _typeAlias_DescribeArgs<T>
export type { DescribeArgs }

import { describe as _namespace_describe } from "jsr:@std/[email protected]/bdd"
/**
 * Additional properties on the `describe` function.
 */
const describe = _namespace_describe as typeof _namespace_describe
export { describe }