@logtape/testing-bun 2.3.0-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mod.d.cts ADDED
@@ -0,0 +1,151 @@
1
+ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, jest, mock, setDefaultTimeout, setSystemTime, spyOn } from "bun:test";
2
+ import { FailureLogReportMode, FailureLogReporterOptions, FailureLogReporterOptions as FailureLogReporterOptions$1 } from "@logtape/testing/reporter";
3
+
4
+ //#region src/mod.d.ts
5
+
6
+ /**
7
+ * Options accepted by Bun's `test()` and `it()` functions.
8
+ *
9
+ * The shape mirrors Bun's documented option bag while allowing newer Bun
10
+ * options to pass through even when bundled TypeScript declarations lag behind
11
+ * the current runtime.
12
+ *
13
+ * @since 2.3.0
14
+ */
15
+ interface BunTestOptions {
16
+ readonly retry?: number;
17
+ readonly repeats?: number;
18
+ readonly timeout?: number;
19
+ readonly [option: string]: unknown;
20
+ }
21
+ /**
22
+ * A callback passed to Bun's `test()` or `it()`.
23
+ *
24
+ * @since 2.3.0
25
+ */
26
+ type BunTestCallback = (() => unknown) | ((done: BunDoneCallback) => unknown);
27
+ /**
28
+ * A Bun `test()`-compatible function.
29
+ *
30
+ * @since 2.3.0
31
+ */
32
+ interface BunTestFunction {
33
+ (name: string, fn?: BunTestCallback, options?: number | BunTestOptions): void;
34
+ (name: string, options: number | BunTestOptions, fn?: BunTestCallback): void;
35
+ readonly skip: BunTestFunction & BunParameterizedTestFactory;
36
+ readonly todo: BunTestFunction & BunParameterizedTestFactory;
37
+ readonly only: BunTestFunction & BunParameterizedTestFactory;
38
+ readonly failing: BunTestFunction & BunParameterizedTestFactory;
39
+ readonly concurrent: BunTestFunction & BunParameterizedTestFactory;
40
+ readonly serial: BunTestFunction & BunParameterizedTestFactory;
41
+ readonly each: BunEachFunction;
42
+ readonly if: BunConditionalTestFactory;
43
+ readonly skipIf: BunConditionalTestFactory;
44
+ readonly todoIf: BunConditionalTestFactory;
45
+ }
46
+ interface BunParameterizedTestFactory {
47
+ readonly each: BunEachFunction;
48
+ }
49
+ interface BunConditionalTestFactory {
50
+ (condition: unknown): BunTestFunction & BunParameterizedTestFactory;
51
+ }
52
+ interface BunEachFunction {
53
+ (...cases: readonly unknown[]): BunEachRegisterFunction;
54
+ }
55
+ interface BunEachRegisterFunction {
56
+ (name: string, fn: (...args: never[]) => unknown, options?: number | BunTestOptions): void;
57
+ (name: string, options: number | BunTestOptions, fn: (...args: never[]) => unknown): void;
58
+ }
59
+ type BunDoneCallback = (error?: unknown) => void;
60
+ type BunFunction = (...args: unknown[]) => unknown;
61
+ type ExpectTypeOfFunction = (...args: unknown[]) => unknown;
62
+ type OnTestFinishedFunction = (callback: () => unknown) => void;
63
+ declare const expectTypeOf: ExpectTypeOfFunction;
64
+ declare const onTestFinished: OnTestFinishedFunction;
65
+ declare const vi: typeof jest;
66
+ declare const xdescribe: BunFunction;
67
+ declare const xit: BunFunction;
68
+ declare const xtest: BunFunction;
69
+ /**
70
+ * Creates a `bun:test` test function that reports LogTape records from failed
71
+ * test callbacks.
72
+ *
73
+ * The returned function preserves Bun test options and shorthand helpers such
74
+ * as `test.skip()`, `test.todo()`, `test.only()`, `test.if()`,
75
+ * `test.failing()`, `test.concurrent()`, `test.serial()`, and `test.each()`.
76
+ * Only callback arguments are adapted; options are passed through to
77
+ * `bun:test`.
78
+ *
79
+ * @param options Failure log reporter options.
80
+ * @returns A configured `bun:test`-compatible test function.
81
+ * @since 2.3.0
82
+ */
83
+ declare function createTest(options?: FailureLogReporterOptions$1): BunTestFunction;
84
+ /**
85
+ * Creates an `it()` alias that reports LogTape records from failed test
86
+ * callbacks.
87
+ *
88
+ * @param options Failure log reporter options.
89
+ * @returns A configured `bun:test`-compatible `it()` function.
90
+ * @since 2.3.0
91
+ */
92
+ declare function createIt(options?: FailureLogReporterOptions$1): BunTestFunction;
93
+ /**
94
+ * A `bun:test` test function that reports LogTape records from failed test
95
+ * callbacks using the default reporter options.
96
+ *
97
+ * @since 2.3.0
98
+ */
99
+ declare const test: BunTestFunction;
100
+ /**
101
+ * A `bun:test` `it()` alias that reports LogTape records from failed test
102
+ * callbacks using the default reporter options.
103
+ *
104
+ * @since 2.3.0
105
+ */
106
+ declare const it: BunTestFunction;
107
+ /**
108
+ * Shorthand for skipping a test.
109
+ *
110
+ * @since 2.3.0
111
+ */
112
+ declare const skip: BunTestFunction;
113
+ /**
114
+ * Shorthand for marking a test as TODO.
115
+ *
116
+ * @since 2.3.0
117
+ */
118
+ declare const todo: BunTestFunction;
119
+ /**
120
+ * Shorthand for marking a test as `only`.
121
+ *
122
+ * @since 2.3.0
123
+ */
124
+ declare const only: BunTestFunction;
125
+ /**
126
+ * Shorthand for marking a test as expected to fail.
127
+ *
128
+ * @since 2.3.0
129
+ */
130
+ declare const failing: BunTestFunction;
131
+ /**
132
+ * Shorthand for running a test concurrently.
133
+ *
134
+ * @since 2.3.0
135
+ */
136
+ declare const concurrent: BunTestFunction;
137
+ /**
138
+ * Shorthand for running a test serially.
139
+ *
140
+ * @since 2.3.0
141
+ */
142
+ declare const serial: BunTestFunction;
143
+ /**
144
+ * Shorthand for Bun's parameterized tests.
145
+ *
146
+ * @since 2.3.0
147
+ */
148
+ declare const each: BunEachFunction;
149
+ //#endregion
150
+ export { BunTestCallback, BunTestFunction, BunTestOptions, FailureLogReportMode, FailureLogReporterOptions, afterAll, afterEach, beforeAll, beforeEach, concurrent, createIt, createTest, test as default, test, describe, each, expect, expectTypeOf, failing, it, jest, mock, onTestFinished, only, serial, setDefaultTimeout, setSystemTime, skip, spyOn, todo, vi, xdescribe, xit, xtest };
151
+ //# sourceMappingURL=mod.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.cts","names":[],"sources":["../src/mod.ts"],"sourcesContent":[],"mappings":";;;;;AAuDA;AAYA;AASA;;;;;;;AAGmC,UAxBlB,cAAA,CAwBkB;EAA2B,SAC7C,KAAA,CAAA,EAAA,MAAA;E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terAll, afterEach, beforeAll, beforeEach, describe, expect, jest, mock, setDefaultTimeout, setSystemTime, spyOn } from "bun:test";
2
+ import { FailureLogReportMode, FailureLogReporterOptions, FailureLogReporterOptions as FailureLogReporterOptions$1 } from "@logtape/testing/reporter";
3
+
4
+ //#region src/mod.d.ts
5
+
6
+ /**
7
+ * Options accepted by Bun's `test()` and `it()` functions.
8
+ *
9
+ * The shape mirrors Bun's documented option bag while allowing newer Bun
10
+ * options to pass through even when bundled TypeScript declarations lag behind
11
+ * the current runtime.
12
+ *
13
+ * @since 2.3.0
14
+ */
15
+ interface BunTestOptions {
16
+ readonly retry?: number;
17
+ readonly repeats?: number;
18
+ readonly timeout?: number;
19
+ readonly [option: string]: unknown;
20
+ }
21
+ /**
22
+ * A callback passed to Bun's `test()` or `it()`.
23
+ *
24
+ * @since 2.3.0
25
+ */
26
+ type BunTestCallback = (() => unknown) | ((done: BunDoneCallback) => unknown);
27
+ /**
28
+ * A Bun `test()`-compatible function.
29
+ *
30
+ * @since 2.3.0
31
+ */
32
+ interface BunTestFunction {
33
+ (name: string, fn?: BunTestCallback, options?: number | BunTestOptions): void;
34
+ (name: string, options: number | BunTestOptions, fn?: BunTestCallback): void;
35
+ readonly skip: BunTestFunction & BunParameterizedTestFactory;
36
+ readonly todo: BunTestFunction & BunParameterizedTestFactory;
37
+ readonly only: BunTestFunction & BunParameterizedTestFactory;
38
+ readonly failing: BunTestFunction & BunParameterizedTestFactory;
39
+ readonly concurrent: BunTestFunction & BunParameterizedTestFactory;
40
+ readonly serial: BunTestFunction & BunParameterizedTestFactory;
41
+ readonly each: BunEachFunction;
42
+ readonly if: BunConditionalTestFactory;
43
+ readonly skipIf: BunConditionalTestFactory;
44
+ readonly todoIf: BunConditionalTestFactory;
45
+ }
46
+ interface BunParameterizedTestFactory {
47
+ readonly each: BunEachFunction;
48
+ }
49
+ interface BunConditionalTestFactory {
50
+ (condition: unknown): BunTestFunction & BunParameterizedTestFactory;
51
+ }
52
+ interface BunEachFunction {
53
+ (...cases: readonly unknown[]): BunEachRegisterFunction;
54
+ }
55
+ interface BunEachRegisterFunction {
56
+ (name: string, fn: (...args: never[]) => unknown, options?: number | BunTestOptions): void;
57
+ (name: string, options: number | BunTestOptions, fn: (...args: never[]) => unknown): void;
58
+ }
59
+ type BunDoneCallback = (error?: unknown) => void;
60
+ type BunFunction = (...args: unknown[]) => unknown;
61
+ type ExpectTypeOfFunction = (...args: unknown[]) => unknown;
62
+ type OnTestFinishedFunction = (callback: () => unknown) => void;
63
+ declare const expectTypeOf: ExpectTypeOfFunction;
64
+ declare const onTestFinished: OnTestFinishedFunction;
65
+ declare const vi: typeof jest;
66
+ declare const xdescribe: BunFunction;
67
+ declare const xit: BunFunction;
68
+ declare const xtest: BunFunction;
69
+ /**
70
+ * Creates a `bun:test` test function that reports LogTape records from failed
71
+ * test callbacks.
72
+ *
73
+ * The returned function preserves Bun test options and shorthand helpers such
74
+ * as `test.skip()`, `test.todo()`, `test.only()`, `test.if()`,
75
+ * `test.failing()`, `test.concurrent()`, `test.serial()`, and `test.each()`.
76
+ * Only callback arguments are adapted; options are passed through to
77
+ * `bun:test`.
78
+ *
79
+ * @param options Failure log reporter options.
80
+ * @returns A configured `bun:test`-compatible test function.
81
+ * @since 2.3.0
82
+ */
83
+ declare function createTest(options?: FailureLogReporterOptions$1): BunTestFunction;
84
+ /**
85
+ * Creates an `it()` alias that reports LogTape records from failed test
86
+ * callbacks.
87
+ *
88
+ * @param options Failure log reporter options.
89
+ * @returns A configured `bun:test`-compatible `it()` function.
90
+ * @since 2.3.0
91
+ */
92
+ declare function createIt(options?: FailureLogReporterOptions$1): BunTestFunction;
93
+ /**
94
+ * A `bun:test` test function that reports LogTape records from failed test
95
+ * callbacks using the default reporter options.
96
+ *
97
+ * @since 2.3.0
98
+ */
99
+ declare const test: BunTestFunction;
100
+ /**
101
+ * A `bun:test` `it()` alias that reports LogTape records from failed test
102
+ * callbacks using the default reporter options.
103
+ *
104
+ * @since 2.3.0
105
+ */
106
+ declare const it: BunTestFunction;
107
+ /**
108
+ * Shorthand for skipping a test.
109
+ *
110
+ * @since 2.3.0
111
+ */
112
+ declare const skip: BunTestFunction;
113
+ /**
114
+ * Shorthand for marking a test as TODO.
115
+ *
116
+ * @since 2.3.0
117
+ */
118
+ declare const todo: BunTestFunction;
119
+ /**
120
+ * Shorthand for marking a test as `only`.
121
+ *
122
+ * @since 2.3.0
123
+ */
124
+ declare const only: BunTestFunction;
125
+ /**
126
+ * Shorthand for marking a test as expected to fail.
127
+ *
128
+ * @since 2.3.0
129
+ */
130
+ declare const failing: BunTestFunction;
131
+ /**
132
+ * Shorthand for running a test concurrently.
133
+ *
134
+ * @since 2.3.0
135
+ */
136
+ declare const concurrent: BunTestFunction;
137
+ /**
138
+ * Shorthand for running a test serially.
139
+ *
140
+ * @since 2.3.0
141
+ */
142
+ declare const serial: BunTestFunction;
143
+ /**
144
+ * Shorthand for Bun's parameterized tests.
145
+ *
146
+ * @since 2.3.0
147
+ */
148
+ declare const each: BunEachFunction;
149
+ //#endregion
150
+ export { BunTestCallback, BunTestFunction, BunTestOptions, FailureLogReportMode, FailureLogReporterOptions, afterAll, afterEach, beforeAll, beforeEach, concurrent, createIt, createTest, test as default, test, describe, each, expect, expectTypeOf, failing, it, jest, mock, onTestFinished, only, serial, setDefaultTimeout, setSystemTime, skip, spyOn, todo, vi, xdescribe, xit, xtest };
151
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","names":[],"sources":["../src/mod.ts"],"sourcesContent":[],"mappings":";;;;;AAuDA;AAYA;AASA;;;;;;;AAGmC,UAxBlB,cAAA,CAwBkB;EAA2B,SAC7C,KAAA,CAAA,EAAA,MAAA;EAAe,SAAG,OAAA,CAAA,EAAA,MAAA;EAA2B,SAC7C,OAAA,CAAA,EAAA,MAAA;EAAe,UAAG,MAAA,EAAA,MAAA,CAAA,EAAA,OAAA;;;;;;;AAIlB,KAlBL,eAAA,GAkBK,C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AAA,OAAA,CAAA,EAAA,MAAA,GA9EoB,cA8EpB,CAAA,EAAA,IAAA;EAAe,CAAA,IAAA,EAAA,MAAA,EAAA,OAAA,EAAA,MAAA,GA1EI,cA0EJ,EAAA,EAAA,EAAA,CAAA,GAAA,IAAA,EAAA,KAAA,EAAA,EAAA,GAAA,OAAA,CAAA,EAAA,IAAA;AAelB;KApFK,eAAA,GAoFmB,CAAA,KAAA,CAAA,EAAA,OAAA,EAAA,GAAA,IAAA;KAlFnB,WAAA,GAmFM,CAAA,GAAA,IAAA,EAAA,OAAA,EAAA,EAAA,GAAA,OAAA;KAlFN,oBAAA,GAmFF,CAAA,GAAA,IAAA,EAAA,OAAA,EAAA,EAAA,GAAA,OAAA;AAAe,KAlFb,sBAAA,GAkFa,CAAA,QAAA,EAAA,GAAA,GAAA,OAAA,EAAA,GAAA,IAAA;AAalB,cAlEM,YAkEa,EAlEC,oBAkE6B;AAQjD,cAvEM,cAuEW,EAvEK,sBAuEuB;AAO7C,cAzEM,EAyEwC,EAAA,OAzE7B,IAyEE;AAOnB,cA9EM,SA8Ea,EA9EF,WA8EE;AAOnB,cAlFM,GAkFwC,EAlFnC,WAkFQ;AAOnB,cAvFM,KAuF8C,EAvFvC,WAuFS;AAOtB;AAOA;AAOA;;;;;;;;;;;;iBAzFgB,UAAA,WACL,8BACR;;;;;;;;;iBAea,QAAA,WACL,8BACR;;;;;;;cAaU,MAAM;;;;;;;cAQN,IAAI;;;;;;cAOJ,MAAM;;;;;;cAON,MAAM;;;;;;cAON,MAAM;;;;;;cAON,SAAS;;;;;;cAOT,YAAY;;;;;;cAOZ,QAAQ;;;;;;cAOR,MAAM"}
package/dist/mod.js ADDED
@@ -0,0 +1,208 @@
1
+ import * as bunTestModule from "bun:test";
2
+ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it as it$1, jest, mock, setDefaultTimeout, setSystemTime, spyOn, test as test$1 } from "bun:test";
3
+ import { createFailureLogReporter } from "@logtape/testing/reporter";
4
+
5
+ //#region src/mod.ts
6
+ const helperNames = [
7
+ "skip",
8
+ "todo",
9
+ "only",
10
+ "failing",
11
+ "concurrent",
12
+ "serial"
13
+ ];
14
+ const conditionalHelperNames = [
15
+ "if",
16
+ "skipIf",
17
+ "todoIf"
18
+ ];
19
+ const expectTypeOf = bunTestModule.expectTypeOf;
20
+ const onTestFinished = bunTestModule.onTestFinished;
21
+ const vi = bunTestModule.vi;
22
+ const xdescribe = bunTestModule.xdescribe;
23
+ const xit = bunTestModule.xit;
24
+ const xtest = bunTestModule.xtest;
25
+ /**
26
+ * Creates a `bun:test` test function that reports LogTape records from failed
27
+ * test callbacks.
28
+ *
29
+ * The returned function preserves Bun test options and shorthand helpers such
30
+ * as `test.skip()`, `test.todo()`, `test.only()`, `test.if()`,
31
+ * `test.failing()`, `test.concurrent()`, `test.serial()`, and `test.each()`.
32
+ * Only callback arguments are adapted; options are passed through to
33
+ * `bun:test`.
34
+ *
35
+ * @param options Failure log reporter options.
36
+ * @returns A configured `bun:test`-compatible test function.
37
+ * @since 2.3.0
38
+ */
39
+ function createTest(options = {}) {
40
+ return createBunTestFunction(test$1, options);
41
+ }
42
+ /**
43
+ * Creates an `it()` alias that reports LogTape records from failed test
44
+ * callbacks.
45
+ *
46
+ * @param options Failure log reporter options.
47
+ * @returns A configured `bun:test`-compatible `it()` function.
48
+ * @since 2.3.0
49
+ */
50
+ function createIt(options = {}) {
51
+ return createBunTestFunction(it$1, options);
52
+ }
53
+ /**
54
+ * A `bun:test` test function that reports LogTape records from failed test
55
+ * callbacks using the default reporter options.
56
+ *
57
+ * @since 2.3.0
58
+ */
59
+ const test = createTest();
60
+ /**
61
+ * A `bun:test` `it()` alias that reports LogTape records from failed test
62
+ * callbacks using the default reporter options.
63
+ *
64
+ * @since 2.3.0
65
+ */
66
+ const it = createIt();
67
+ /**
68
+ * Shorthand for skipping a test.
69
+ *
70
+ * @since 2.3.0
71
+ */
72
+ const skip = test.skip;
73
+ /**
74
+ * Shorthand for marking a test as TODO.
75
+ *
76
+ * @since 2.3.0
77
+ */
78
+ const todo = test.todo;
79
+ /**
80
+ * Shorthand for marking a test as `only`.
81
+ *
82
+ * @since 2.3.0
83
+ */
84
+ const only = test.only;
85
+ /**
86
+ * Shorthand for marking a test as expected to fail.
87
+ *
88
+ * @since 2.3.0
89
+ */
90
+ const failing = test.failing;
91
+ /**
92
+ * Shorthand for running a test concurrently.
93
+ *
94
+ * @since 2.3.0
95
+ */
96
+ const concurrent = test.concurrent;
97
+ /**
98
+ * Shorthand for running a test serially.
99
+ *
100
+ * @since 2.3.0
101
+ */
102
+ const serial = test.serial;
103
+ /**
104
+ * Shorthand for Bun's parameterized tests.
105
+ *
106
+ * @since 2.3.0
107
+ */
108
+ const each = test.each;
109
+ var src_default = test;
110
+ function createBunTestFunction(baseTest, options) {
111
+ const register = (...args) => Reflect.apply(baseTest, void 0, wrapBunTestArguments(args, options));
112
+ for (const helperName of helperNames) {
113
+ const helper = getFunctionProperty(baseTest, helperName);
114
+ if (helper == null) continue;
115
+ Object.defineProperty(register, helperName, {
116
+ configurable: true,
117
+ enumerable: true,
118
+ value: createBunTestFunction(helper, options),
119
+ writable: true
120
+ });
121
+ }
122
+ for (const helperName of conditionalHelperNames) {
123
+ const helper = getFunctionProperty(baseTest, helperName);
124
+ if (helper == null) continue;
125
+ Object.defineProperty(register, helperName, {
126
+ configurable: true,
127
+ enumerable: true,
128
+ value: (condition) => {
129
+ const conditionalTest = Reflect.apply(helper, baseTest, [condition]);
130
+ return createBunTestFunction(conditionalTest, options);
131
+ },
132
+ writable: true
133
+ });
134
+ }
135
+ const each$1 = getFunctionProperty(baseTest, "each");
136
+ if (each$1 != null) Object.defineProperty(register, "each", {
137
+ configurable: true,
138
+ enumerable: true,
139
+ value: createWrappedEach(baseTest, each$1, options),
140
+ writable: true
141
+ });
142
+ return register;
143
+ }
144
+ function createWrappedEach(baseTest, baseEach, options) {
145
+ return (...cases) => {
146
+ const registerEach = Reflect.apply(baseEach, baseTest, cases);
147
+ return (...args) => Reflect.apply(registerEach, void 0, wrapBunEachArguments(args, options));
148
+ };
149
+ }
150
+ function wrapBunTestArguments(args, options) {
151
+ const callbackIndex = args.findIndex((arg) => typeof arg === "function");
152
+ if (callbackIndex < 0) return [...args];
153
+ return [
154
+ ...args.slice(0, callbackIndex),
155
+ wrapBunTestCallback(args[callbackIndex], options),
156
+ ...args.slice(callbackIndex + 1)
157
+ ];
158
+ }
159
+ function wrapBunEachArguments(args, options) {
160
+ const callbackIndex = args.findIndex((arg, index) => index > 0 && typeof arg === "function");
161
+ if (callbackIndex < 0) return [...args];
162
+ return [
163
+ ...args.slice(0, callbackIndex),
164
+ wrapBunEachCallback(args[callbackIndex], options),
165
+ ...args.slice(callbackIndex + 1)
166
+ ];
167
+ }
168
+ function wrapBunTestCallback(callback, options) {
169
+ const reporter = createFailureLogReporter(options);
170
+ if (callback.length >= 1) return function(done) {
171
+ const wrapped = reporter.wrap(() => new Promise((resolve, reject) => {
172
+ let settled = false;
173
+ const wrappedDone = (error) => {
174
+ if (settled) return;
175
+ settled = true;
176
+ if (error == null) resolve();
177
+ else reject(error);
178
+ };
179
+ try {
180
+ Reflect.apply(callback, this, [wrappedDone]);
181
+ } catch (error) {
182
+ reject(error);
183
+ }
184
+ }));
185
+ wrapped().then(() => done(), (error) => done(error));
186
+ };
187
+ return function() {
188
+ return reporter.run(() => Reflect.apply(callback, this, []));
189
+ };
190
+ }
191
+ function wrapBunEachCallback(callback, options) {
192
+ const reporter = createFailureLogReporter(options);
193
+ return function(...args) {
194
+ return reporter.run(() => Reflect.apply(callback, this, args));
195
+ };
196
+ }
197
+ function getFunctionProperty(value, property) {
198
+ try {
199
+ const propertyValue = Reflect.get(value, property);
200
+ return typeof propertyValue === "function" ? propertyValue : void 0;
201
+ } catch {
202
+ return void 0;
203
+ }
204
+ }
205
+
206
+ //#endregion
207
+ export { afterAll, afterEach, beforeAll, beforeEach, concurrent, createIt, createTest, src_default as default, describe, each, expect, expectTypeOf, failing, it, jest, mock, onTestFinished, only, serial, setDefaultTimeout, setSystemTime, skip, spyOn, test, todo, vi, xdescribe, xit, xtest };
208
+ //# sourceMappingURL=mod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.js","names":["expectTypeOf: ExpectTypeOfFunction","onTestFinished: OnTestFinishedFunction","vi: typeof jest","xdescribe: BunFunction","xit: BunFunction","xtest: BunFunction","options: FailureLogReporterOptions","bunTest","bunIt","test: BunTestFunction","it: BunTestFunction","skip: BunTestFunction","todo: BunTestFunction","only: BunTestFunction","failing: BunTestFunction","concurrent: BunTestFunction","serial: BunTestFunction","each: BunEachFunction","baseTest: BaseBunTestFunction","condition: unknown","each","baseEach: AnyFunction","args: readonly unknown[]","callback: AnyFunction","done: BunDoneCallback","wrappedDone: BunDoneCallback","error?: unknown","error: unknown","value: BaseBunTestFunction","property: string"],"sources":["../src/mod.ts"],"sourcesContent":["import {\n afterAll,\n afterEach,\n beforeAll,\n beforeEach,\n describe,\n expect,\n it as bunIt,\n jest,\n mock,\n setDefaultTimeout,\n setSystemTime,\n spyOn,\n test as bunTest,\n} from \"bun:test\";\nimport * as bunTestModule from \"bun:test\";\n\nimport {\n createFailureLogReporter,\n type FailureLogReporterOptions,\n} from \"@logtape/testing/reporter\";\n\nexport type {\n FailureLogReporterOptions,\n FailureLogReportMode,\n} from \"@logtape/testing/reporter\";\nexport {\n afterAll,\n afterEach,\n beforeAll,\n beforeEach,\n describe,\n expect,\n expectTypeOf,\n jest,\n mock,\n onTestFinished,\n setDefaultTimeout,\n setSystemTime,\n spyOn,\n vi,\n xdescribe,\n xit,\n xtest,\n};\n\n/**\n * Options accepted by Bun's `test()` and `it()` functions.\n *\n * The shape mirrors Bun's documented option bag while allowing newer Bun\n * options to pass through even when bundled TypeScript declarations lag behind\n * the current runtime.\n *\n * @since 2.3.0\n */\nexport interface BunTestOptions {\n readonly retry?: number;\n readonly repeats?: number;\n readonly timeout?: number;\n readonly [option: string]: unknown;\n}\n\n/**\n * A callback passed to Bun's `test()` or `it()`.\n *\n * @since 2.3.0\n */\nexport type BunTestCallback =\n | (() => unknown)\n | ((done: BunDoneCallback) => unknown);\n\n/**\n * A Bun `test()`-compatible function.\n *\n * @since 2.3.0\n */\nexport interface BunTestFunction {\n (name: string, fn?: BunTestCallback, options?: number | BunTestOptions): void;\n (name: string, options: number | BunTestOptions, fn?: BunTestCallback): void;\n readonly skip: BunTestFunction & BunParameterizedTestFactory;\n readonly todo: BunTestFunction & BunParameterizedTestFactory;\n readonly only: BunTestFunction & BunParameterizedTestFactory;\n readonly failing: BunTestFunction & BunParameterizedTestFactory;\n readonly concurrent: BunTestFunction & BunParameterizedTestFactory;\n readonly serial: BunTestFunction & BunParameterizedTestFactory;\n readonly each: BunEachFunction;\n readonly if: BunConditionalTestFactory;\n readonly skipIf: BunConditionalTestFactory;\n readonly todoIf: BunConditionalTestFactory;\n}\n\ninterface BunParameterizedTestFactory {\n readonly each: BunEachFunction;\n}\n\ninterface BunConditionalTestFactory {\n (condition: unknown): BunTestFunction & BunParameterizedTestFactory;\n}\n\ninterface BunEachFunction {\n (...cases: readonly unknown[]): BunEachRegisterFunction;\n}\n\ninterface BunEachRegisterFunction {\n (\n name: string,\n fn: (...args: never[]) => unknown,\n options?: number | BunTestOptions,\n ): void;\n (\n name: string,\n options: number | BunTestOptions,\n fn: (...args: never[]) => unknown,\n ): void;\n}\n\ntype BunDoneCallback = (error?: unknown) => void;\ntype AnyFunction = (...args: never[]) => unknown;\ntype BunFunction = (...args: unknown[]) => unknown;\ntype ExpectTypeOfFunction = (...args: unknown[]) => unknown;\ntype OnTestFinishedFunction = (callback: () => unknown) => void;\ntype BaseBunTestFunction = AnyFunction & {\n readonly skip?: BaseBunTestFunction;\n readonly todo?: BaseBunTestFunction;\n readonly only?: BaseBunTestFunction;\n readonly failing?: BaseBunTestFunction;\n readonly concurrent?: BaseBunTestFunction;\n readonly serial?: BaseBunTestFunction;\n readonly each?: AnyFunction;\n readonly if?: AnyFunction;\n readonly skipIf?: AnyFunction;\n readonly todoIf?: AnyFunction;\n};\n\nconst helperNames = [\n \"skip\",\n \"todo\",\n \"only\",\n \"failing\",\n \"concurrent\",\n \"serial\",\n] as const;\n\nconst conditionalHelperNames = [\n \"if\",\n \"skipIf\",\n \"todoIf\",\n] as const;\n\nconst expectTypeOf: ExpectTypeOfFunction = (\n bunTestModule as unknown as { readonly expectTypeOf: ExpectTypeOfFunction }\n).expectTypeOf;\nconst onTestFinished: OnTestFinishedFunction = (\n bunTestModule as unknown as {\n readonly onTestFinished: OnTestFinishedFunction;\n }\n).onTestFinished;\nconst vi: typeof jest =\n (bunTestModule as unknown as { readonly vi: typeof jest }).vi;\nconst xdescribe: BunFunction =\n (bunTestModule as unknown as { readonly xdescribe: BunFunction })\n .xdescribe;\nconst xit: BunFunction =\n (bunTestModule as unknown as { readonly xit: BunFunction }).xit;\nconst xtest: BunFunction = (bunTestModule as unknown as {\n readonly xtest: BunFunction;\n})\n .xtest;\n\n/**\n * Creates a `bun:test` test function that reports LogTape records from failed\n * test callbacks.\n *\n * The returned function preserves Bun test options and shorthand helpers such\n * as `test.skip()`, `test.todo()`, `test.only()`, `test.if()`,\n * `test.failing()`, `test.concurrent()`, `test.serial()`, and `test.each()`.\n * Only callback arguments are adapted; options are passed through to\n * `bun:test`.\n *\n * @param options Failure log reporter options.\n * @returns A configured `bun:test`-compatible test function.\n * @since 2.3.0\n */\nexport function createTest(\n options: FailureLogReporterOptions = {},\n): BunTestFunction {\n return createBunTestFunction(\n bunTest as unknown as BaseBunTestFunction,\n options,\n );\n}\n\n/**\n * Creates an `it()` alias that reports LogTape records from failed test\n * callbacks.\n *\n * @param options Failure log reporter options.\n * @returns A configured `bun:test`-compatible `it()` function.\n * @since 2.3.0\n */\nexport function createIt(\n options: FailureLogReporterOptions = {},\n): BunTestFunction {\n return createBunTestFunction(\n bunIt as unknown as BaseBunTestFunction,\n options,\n );\n}\n\n/**\n * A `bun:test` test function that reports LogTape records from failed test\n * callbacks using the default reporter options.\n *\n * @since 2.3.0\n */\nexport const test: BunTestFunction = createTest();\n\n/**\n * A `bun:test` `it()` alias that reports LogTape records from failed test\n * callbacks using the default reporter options.\n *\n * @since 2.3.0\n */\nexport const it: BunTestFunction = createIt();\n\n/**\n * Shorthand for skipping a test.\n *\n * @since 2.3.0\n */\nexport const skip: BunTestFunction = test.skip;\n\n/**\n * Shorthand for marking a test as TODO.\n *\n * @since 2.3.0\n */\nexport const todo: BunTestFunction = test.todo;\n\n/**\n * Shorthand for marking a test as `only`.\n *\n * @since 2.3.0\n */\nexport const only: BunTestFunction = test.only;\n\n/**\n * Shorthand for marking a test as expected to fail.\n *\n * @since 2.3.0\n */\nexport const failing: BunTestFunction = test.failing;\n\n/**\n * Shorthand for running a test concurrently.\n *\n * @since 2.3.0\n */\nexport const concurrent: BunTestFunction = test.concurrent;\n\n/**\n * Shorthand for running a test serially.\n *\n * @since 2.3.0\n */\nexport const serial: BunTestFunction = test.serial;\n\n/**\n * Shorthand for Bun's parameterized tests.\n *\n * @since 2.3.0\n */\nexport const each: BunEachFunction = test.each;\n\nexport default test;\n\nfunction createBunTestFunction(\n baseTest: BaseBunTestFunction,\n options: FailureLogReporterOptions,\n): BunTestFunction {\n const register = ((...args: unknown[]) =>\n Reflect.apply(\n baseTest,\n undefined,\n wrapBunTestArguments(args, options),\n )) as BunTestFunction;\n\n for (const helperName of helperNames) {\n const helper = getFunctionProperty(baseTest, helperName);\n if (helper == null) continue;\n Object.defineProperty(register, helperName, {\n configurable: true,\n enumerable: true,\n value: createBunTestFunction(\n helper as BaseBunTestFunction,\n options,\n ),\n writable: true,\n });\n }\n\n for (const helperName of conditionalHelperNames) {\n const helper = getFunctionProperty(baseTest, helperName);\n if (helper == null) continue;\n Object.defineProperty(register, helperName, {\n configurable: true,\n enumerable: true,\n value: ((condition: unknown) => {\n const conditionalTest = Reflect.apply(helper, baseTest, [condition]);\n return createBunTestFunction(\n conditionalTest as BaseBunTestFunction,\n options,\n );\n }) as BunConditionalTestFactory,\n writable: true,\n });\n }\n\n const each = getFunctionProperty(baseTest, \"each\");\n if (each != null) {\n Object.defineProperty(register, \"each\", {\n configurable: true,\n enumerable: true,\n value: createWrappedEach(baseTest, each, options),\n writable: true,\n });\n }\n\n return register;\n}\n\nfunction createWrappedEach(\n baseTest: BaseBunTestFunction,\n baseEach: AnyFunction,\n options: FailureLogReporterOptions,\n): BunEachFunction {\n return ((...cases: readonly unknown[]) => {\n const registerEach = Reflect.apply(baseEach, baseTest, cases);\n return ((...args: unknown[]) =>\n Reflect.apply(\n registerEach as AnyFunction,\n undefined,\n wrapBunEachArguments(args, options),\n )) as BunEachRegisterFunction;\n }) as BunEachFunction;\n}\n\nfunction wrapBunTestArguments(\n args: readonly unknown[],\n options: FailureLogReporterOptions,\n): unknown[] {\n const callbackIndex = args.findIndex((arg) => typeof arg === \"function\");\n if (callbackIndex < 0) return [...args];\n\n return [\n ...args.slice(0, callbackIndex),\n wrapBunTestCallback(args[callbackIndex] as AnyFunction, options),\n ...args.slice(callbackIndex + 1),\n ];\n}\n\nfunction wrapBunEachArguments(\n args: readonly unknown[],\n options: FailureLogReporterOptions,\n): unknown[] {\n const callbackIndex = args.findIndex((arg, index) =>\n index > 0 && typeof arg === \"function\"\n );\n if (callbackIndex < 0) return [...args];\n\n return [\n ...args.slice(0, callbackIndex),\n wrapBunEachCallback(args[callbackIndex] as AnyFunction, options),\n ...args.slice(callbackIndex + 1),\n ];\n}\n\nfunction wrapBunTestCallback(\n callback: AnyFunction,\n options: FailureLogReporterOptions,\n): AnyFunction {\n const reporter = createFailureLogReporter(options);\n\n if (callback.length >= 1) {\n return function (this: unknown, done: BunDoneCallback): void {\n const wrapped = reporter.wrap(() =>\n new Promise<void>((resolve, reject) => {\n let settled = false;\n const wrappedDone: BunDoneCallback = (error?: unknown) => {\n if (settled) return;\n settled = true;\n if (error == null) resolve();\n else reject(error);\n };\n\n try {\n Reflect.apply(callback, this, [wrappedDone]);\n } catch (error) {\n reject(error);\n }\n })\n );\n\n void wrapped().then(\n () => done(),\n (error: unknown) => done(error),\n );\n };\n }\n\n return function (this: unknown): Promise<unknown> {\n return reporter.run(() => Reflect.apply(callback, this, []));\n };\n}\n\nfunction wrapBunEachCallback(\n callback: AnyFunction,\n options: FailureLogReporterOptions,\n): AnyFunction {\n const reporter = createFailureLogReporter(options);\n return function (this: unknown, ...args: never[]) {\n return reporter.run(() => Reflect.apply(callback, this, args));\n };\n}\n\nfunction getFunctionProperty(\n value: BaseBunTestFunction,\n property: string,\n): AnyFunction | undefined {\n try {\n const propertyValue = Reflect.get(value, property);\n return typeof propertyValue === \"function\" ? propertyValue : undefined;\n } catch {\n return undefined;\n }\n}\n"],"mappings":";;;;;AAsIA,MAAM,cAAc;CAClB;CACA;CACA;CACA;CACA;CACA;AACD;AAED,MAAM,yBAAyB;CAC7B;CACA;CACA;AACD;AAED,MAAMA,eACJ,cACA;AACF,MAAMC,iBACJ,cAGA;AACF,MAAMC,KACH,cAA0D;AAC7D,MAAMC,YACH,cACE;AACL,MAAMC,MACH,cAA2D;AAC9D,MAAMC,QAAsB,cAGzB;;;;;;;;;;;;;;;AAgBH,SAAgB,WACdC,UAAqC,CAAE,GACtB;AACjB,QAAO,sBACLC,QACA,QACD;AACF;;;;;;;;;AAUD,SAAgB,SACdD,UAAqC,CAAE,GACtB;AACjB,QAAO,sBACLE,MACA,QACD;AACF;;;;;;;AAQD,MAAaC,OAAwB,YAAY;;;;;;;AAQjD,MAAaC,KAAsB,UAAU;;;;;;AAO7C,MAAaC,OAAwB,KAAK;;;;;;AAO1C,MAAaC,OAAwB,KAAK;;;;;;AAO1C,MAAaC,OAAwB,KAAK;;;;;;AAO1C,MAAaC,UAA2B,KAAK;;;;;;AAO7C,MAAaC,aAA8B,KAAK;;;;;;AAOhD,MAAaC,SAA0B,KAAK;;;;;;AAO5C,MAAaC,OAAwB,KAAK;AAE1C,kBAAe;AAEf,SAAS,sBACPC,UACAZ,SACiB;CACjB,MAAM,WAAY,CAAC,GAAG,SACpB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@@ -0,0 +1,82 @@
1
+ {
2
+ "name": "@logtape/testing-bun",
3
+ "version": "2.3.0-dev.0",
4
+ "description": "Bun test runner integration for LogTape failure log reporting",
5
+ "keywords": [
6
+ "logging",
7
+ "log",
8
+ "logger",
9
+ "logtape",
10
+ "testing",
11
+ "test",
12
+ "bun:test"
13
+ ],
14
+ "license": "MIT",
15
+ "author": {
16
+ "name": "Hong Minhee",
17
+ "email": "hong@minhee.org",
18
+ "url": "https://hongminhee.org/"
19
+ },
20
+ "homepage": "https://logtape.org/",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/dahlia/logtape.git",
24
+ "directory": "packages/testing-bun/"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/dahlia/logtape/issues"
28
+ },
29
+ "funding": [
30
+ "https://github.com/sponsors/dahlia"
31
+ ],
32
+ "type": "module",
33
+ "module": "./dist/mod.js",
34
+ "main": "./dist/mod.cjs",
35
+ "types": "./dist/mod.d.ts",
36
+ "exports": {
37
+ ".": {
38
+ "types": {
39
+ "import": "./dist/mod.d.ts",
40
+ "require": "./dist/mod.d.cts"
41
+ },
42
+ "import": "./dist/mod.js",
43
+ "require": "./dist/mod.cjs"
44
+ },
45
+ "./autoload": {
46
+ "types": {
47
+ "import": "./dist/autoload.d.ts",
48
+ "require": "./dist/autoload.d.cts"
49
+ },
50
+ "import": "./dist/autoload.js",
51
+ "require": "./dist/autoload.cjs"
52
+ },
53
+ "./package.json": "./package.json"
54
+ },
55
+ "sideEffects": [
56
+ "./dist/autoload.js",
57
+ "./dist/autoload.cjs"
58
+ ],
59
+ "files": [
60
+ "dist/"
61
+ ],
62
+ "dependencies": {
63
+ "@logtape/testing": "^2.3.0"
64
+ },
65
+ "peerDependencies": {
66
+ "@logtape/logtape": "^2.3.0"
67
+ },
68
+ "devDependencies": {
69
+ "@types/bun": "^1.2.15",
70
+ "tsdown": "^0.12.7",
71
+ "typescript": "^5.8.3",
72
+ "@logtape/logtape": "^2.3.0"
73
+ },
74
+ "scripts": {
75
+ "build": "tsdown",
76
+ "prepublish": "tsdown",
77
+ "test": "tsdown && node --experimental-transform-types --test",
78
+ "test:bun": "tsdown && bun test",
79
+ "test:deno": "deno test --allow-read --allow-write --allow-env --allow-run=bun",
80
+ "test-all": "tsdown && node --experimental-transform-types --test && bun test && deno test --allow-read --allow-write --allow-env --allow-run=bun"
81
+ }
82
+ }