Skip to content

@gala-chain/testAPI


API > transactionErrorKey

Function: transactionErrorKey()

transactionErrorKey(key): AsymmetricMatcher_2

Creates a Jest matcher for asserting GalaChain transaction error responses with a specific error key.

Parameters

key: string

The expected error key to match

Returns

A Jest matcher object that can be used with expect().toEqual()

Example

// Assert error response has specific error key
expect(response).toEqual(transactionErrorKey("TOKEN_NOT_FOUND"));
expect(response).toEqual(transactionErrorKey("INSUFFICIENT_BALANCE"));

Source

chain-test/src/matchers.ts:96