aboutsummaryrefslogtreecommitdiff
path: root/test/bun.js/test_scope_debug.ts
diff options
context:
space:
mode:
authorGravatar Colin McDonnell <colinmcd94@gmail.com> 2022-11-09 15:40:40 -0800
committerGravatar GitHub <noreply@github.com> 2022-11-09 15:40:40 -0800
commitf7f1b604443c030afe29d1059b90f72c69afe081 (patch)
tree8f2397447b2a84dab02850007264b72cc565f5d6 /test/bun.js/test_scope_debug.ts
parentda257336b0b70df8c31da647496899cf70670000 (diff)
downloadbun-f7f1b604443c030afe29d1059b90f72c69afe081.tar.gz
bun-f7f1b604443c030afe29d1059b90f72c69afe081.tar.zst
bun-f7f1b604443c030afe29d1059b90f72c69afe081.zip
Add bun-types, add typechecking, add `child_process` types (#1475)
* Add bun-types to packages * Improve typing * Fix types in tests * Fix dts tests * Run formatter * Fix all type errors * Add strict mode, fix type errors * Add ffi changes * Move workflows to root * Add workflows * Remove labeler * Add child_process types * Fix synthetic defaults issue * Remove docs * Move scripts * Run prettier * Include examples in typechecking * captureStackTrace types * moved captureStackTrace types to globals * Address reviews Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Diffstat (limited to 'test/bun.js/test_scope_debug.ts')
-rw-r--r--test/bun.js/test_scope_debug.ts27
1 files changed, 14 insertions, 13 deletions
diff --git a/test/bun.js/test_scope_debug.ts b/test/bun.js/test_scope_debug.ts
index 9af649552..fbc79acd8 100644
--- a/test/bun.js/test_scope_debug.ts
+++ b/test/bun.js/test_scope_debug.ts
@@ -1,3 +1,4 @@
+type AnyFunction = (...args: any[]) => any;
export function wrap({
test: test_,
it: it_,
@@ -6,12 +7,12 @@ export function wrap({
beforeAll: beforeAll_ = undefined,
afterEach: afterEach_ = undefined,
afterAll: afterAll_ = undefined,
-}) {
+}: any) {
if (it_ === undefined) {
it_ = test_;
}
- var describe = (label, cb) => {
+ var describe = (label, cb: AnyFunction) => {
return describe_(
label,
cb instanceof async function () {}.constructor
@@ -34,11 +35,11 @@ export function wrap({
} finally {
console.log(`DESCRIBE [Exit] ${label}`);
}
- }
+ },
);
};
- var it = (label, cb) => {
+ var it = (label, cb: AnyFunction) => {
console.log("Before", label);
return it_(
label,
@@ -62,11 +63,11 @@ export function wrap({
} finally {
console.log(`TEST [Exit] ${label}`);
}
- }
+ },
);
};
- var beforeEach = (cb) => {
+ var beforeEach = (cb: AnyFunction) => {
return beforeEach_(
cb instanceof async function () {}.constructor
? async () => {
@@ -88,10 +89,10 @@ export function wrap({
} finally {
console.log(`BEFORE EACH [Exit]`);
}
- }
+ },
);
};
- var beforeAll = (cb) => {
+ var beforeAll = (cb: AnyFunction) => {
return beforeAll_(
cb instanceof async function () {}.constructor
? async () => {
@@ -113,10 +114,10 @@ export function wrap({
} finally {
console.log(`BEFORE ALL [Exit]`);
}
- }
+ },
);
};
- var afterEach = (cb) => {
+ var afterEach = (cb: AnyFunction) => {
return afterEach_(
cb instanceof async function () {}.constructor
? async () => {
@@ -138,10 +139,10 @@ export function wrap({
} finally {
console.log(`AFTER EACH [Exit]`);
}
- }
+ },
);
};
- var afterAll = (cb) => {
+ var afterAll = (cb: AnyFunction) => {
return afterAll_(
cb instanceof async function () {}.constructor
? async () => {
@@ -163,7 +164,7 @@ export function wrap({
} finally {
console.log(`AFTER ALL [Exit]`);
}
- }
+ },
);
};