-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: display returned function names correctly in stack traces (#528)
Refactors for consistency. * refactor: change functions to be more consistent between regular functions and arrow functions * refactor: rename testHook to be testHarness for consistency * refactor: remove default exports for consistency * fix: display returned function names correctly in stack traces * refactor: remove variable assignment in function name workaround Co-authored-by: Jonathan Peyper <[email protected]> Co-authored-by: Jonathan Peyper <[email protected]>
- Loading branch information
Showing
7 changed files
with
66 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
const resolveAfter = (ms: number) => | ||
new Promise((resolve) => { | ||
function resolveAfter(ms: number) { | ||
return new Promise((resolve) => { | ||
setTimeout(resolve, ms) | ||
}) | ||
} | ||
|
||
const isPromise = <T>(value: unknown): boolean => | ||
typeof (value as PromiseLike<T>).then === 'function' | ||
function isPromise<T>(value: unknown): boolean { | ||
return typeof (value as PromiseLike<T>).then === 'function' | ||
} | ||
|
||
export { isPromise, resolveAfter } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters