Skip to content

Commit

Permalink
feat(playertesting): improve API docs for player testing
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandkakonyi committed Nov 29, 2023
1 parent 7e10e11 commit a416968
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions integration_test/playertesting/PlayerTesting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ export const callPlayer = async <T>(
};

/**
* Calls the given function with the player instance and expects the given event to occur.
* @param fn The function to call.
* Expects the given event to occur.
* @param expectationConvertible The event to expect.
* @param timeoutSeconds The number of seconds to wait for the event to occur.
* @returns A promise that resolves when the function is finished.
Expand All @@ -79,8 +78,7 @@ export const expectEvent = async <T extends Event>(
};

/**
* Calls the given function with the player instance and expects the given events to occur.
* @param fn The function to call.
* Expects the given events to occur.
* @param expectationsConvertible The events to expect.
* @param timeoutSeconds The number of seconds to wait for the events to occur.
* @returns A promise that resolves when the function is finished.
Expand Down Expand Up @@ -111,7 +109,9 @@ export const expectEvents = async (
};

/**
* Calls the given function with the player instance and expects the given event to occur.
* Starts listening for the specified `SingleEventExpectation` before executing the passed `fn` function.
* This is the race-condition-safe version of calling `callPlayer` and `expectEvent` after that.
* Useful when events are directly tied to calls in the `fn` function block and therefore synchronously emitted.
* @param fn The function to call.
* @param expectationConvertible The event to expect.
* @param timeoutSeconds The number of seconds to wait for the event to occur.
Expand Down Expand Up @@ -139,7 +139,9 @@ export const callPlayerAndExpectEvent = async <E extends Event, P>(
};

/**
* Calls the given function with the player instance and expects the given events to occur.
* Starts listening for the specified `MultipleEventExpectation` before executing the passed `fn` function.
* This is the race-condition-safe version of calling `callPlayer` and `expectEvents` after that.
* Useful when events are directly tied to calls in the `fn` function block and therefore synchronously emitted.
* @param fn The function to call.
* @param expectationsConvertible The events to expect.
* @param timeoutSeconds The number of seconds to wait for the events to occur.
Expand Down

0 comments on commit a416968

Please sign in to comment.