aws-cdk-lib.assertions.Match

class Match

LanguageType name
.NETAmazon.CDK.Assertions.Match
Gogithub.com/aws/aws-cdk-go/awscdk/v2/assertions#Match
Javasoftware.amazon.awscdk.assertions.Match
Pythonaws_cdk.assertions.Match
TypeScript (source)aws-cdk-lib » assertions » Match

Partial and special matching during template assertions.

Initializer

new Match()

Methods

NameDescription
static absent()Use this matcher in the place of a field's value, if the field must not be present.
static anyValue()Matches any non-null value at the target.
static arrayEquals(pattern)Matches the specified pattern with the array found in the same relative path of the target.
static arrayWith(pattern)Matches the specified pattern with the array found in the same relative path of the target.
static exact(pattern)Deep exact matching of the specified pattern to the target.
static not(pattern)Matches any target which does NOT follow the specified pattern.
static objectEquals(pattern)Matches the specified pattern to an object found in the same relative path of the target.
static objectLike(pattern)Matches the specified pattern to an object found in the same relative path of the target.
static serializedJson(pattern)Matches any string-encoded JSON and applies the specified pattern after parsing it.
static stringLikeRegexp(pattern)Matches targets according to a regular expression.

static absent()

public static absent(): Matcher

Returns

  • Matcher

Use this matcher in the place of a field's value, if the field must not be present.


static anyValue()

public static anyValue(): Matcher

Returns

  • Matcher

Matches any non-null value at the target.


static arrayEquals(pattern)

public static arrayEquals(pattern: any[]): Matcher

Parameters

  • pattern any[] — the pattern to match.

Returns

  • Matcher

Matches the specified pattern with the array found in the same relative path of the target.

The set of elements (or matchers) must match exactly and in order.


static arrayWith(pattern)

public static arrayWith(pattern: any[]): Matcher

Parameters

  • pattern any[] — the pattern to match.

Returns

  • Matcher

Matches the specified pattern with the array found in the same relative path of the target.

The set of elements (or matchers) must be in the same order as would be found.


static exact(pattern)

public static exact(pattern: any): Matcher

Parameters

  • pattern any — the pattern to match.

Returns

  • Matcher

Deep exact matching of the specified pattern to the target.


static not(pattern)

public static not(pattern: any): Matcher

Parameters

  • pattern any — the pattern to NOT match.

Returns

  • Matcher

Matches any target which does NOT follow the specified pattern.


static objectEquals(pattern)

public static objectEquals(pattern: { [string]: any }): Matcher

Parameters

  • pattern { [string]: any } — the pattern to match.

Returns

  • Matcher

Matches the specified pattern to an object found in the same relative path of the target.

The keys and their values (or matchers) must match exactly with the target.


static objectLike(pattern)

public static objectLike(pattern: { [string]: any }): Matcher

Parameters

  • pattern { [string]: any } — the pattern to match.

Returns

  • Matcher

Matches the specified pattern to an object found in the same relative path of the target.

The keys and their values (or matchers) must be present in the target but the target can be a superset.


static serializedJson(pattern)

public static serializedJson(pattern: any): Matcher

Parameters

  • pattern any — the pattern to match after parsing the encoded JSON.

Returns

  • Matcher

Matches any string-encoded JSON and applies the specified pattern after parsing it.


static stringLikeRegexp(pattern)

public static stringLikeRegexp(pattern: string): Matcher

Parameters

  • pattern string

Returns

  • Matcher

Matches targets according to a regular expression.