@gala-chain/test ∙ API
API > transactionSuccess
Function: transactionSuccess()
transactionSuccess\<
T>(payload?):unknown
Creates a Jest matcher for asserting successful GalaChain transaction responses.
Type parameters
▪ T
The type of the expected payload data
Parameters
▪ payload?: T
Optional expected payload data. If provided, the matcher will also verify the Data field matches this value
Returns
A Jest matcher object that can be used with expect().toEqual()
Example
// Assert successful response without checking payload
expect(response).toEqual(transactionSuccess());
// Assert successful response with specific payload
expect(response).toEqual(transactionSuccess({ tokenId: "123" }));