Prevent waitFor from fulfilling early in util/testing#585
Prevent waitFor from fulfilling early in util/testing#585theycallmeswift merged 6 commits intomainfrom
waitFor from fulfilling early in util/testing#585Conversation
WalkthroughThis update significantly enhances the Flatfile API's handling of asynchronous events. It addresses a bug in the Changes
Sequence Diagram(s)sequenceDiagram
participant Developer
participant FlatfileAPI
participant TestListener
Developer->>FlatfileAPI: Dispatch Event
FlatfileAPI->>TestListener: Log Event
TestListener-->>FlatfileAPI: Acknowledge Event
Developer->>TestListener: Wait for Event
TestListener->>FlatfileAPI: Check Event Status
FlatfileAPI-->>TestListener: Return Event Status
TestListener->>Developer: Resolve Promise
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Additional comments not posted (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (1)
test/toBePendingMatcher.ts (1)
1-3: Consider using a more specific import fromutil.Instead of importing everything from
util, import onlyinspectfor better clarity and potentially smaller bundle size.- import * as util from 'node:util' + import { inspect } from 'node:util'
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This reverts commit ba6f6ef.
Fixed bug where
waitForpromise was being fulfilled immediately. Changedinvocationsto store a log of FlatfileEvents andinvocationWatchersto be compatible with the existingmatchEventmethod on Flatfile Listeners. Also exposedinvocationWatchersto the public API.