class Match
Language | Type name |
---|---|
.NET | Amazon.CDK.Assertions.Match |
Go | github.com/aws/aws-cdk-go/awscdk/v2/assertions#Match |
Java | software.amazon.awscdk.assertions.Match |
Python | aws_cdk.assertions.Match |
TypeScript (source) | aws-cdk-lib » assertions » Match |
Partial and special matching during template assertions.
Initializer
new Match()
Methods
Name | Description |
---|---|
static absent() | Use this matcher in the place of a field's value, if the field must not be present. |
static any | Matches any non-null value at the target. |
static array | Matches the specified pattern with the array found in the same relative path of the target. |
static array | 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 object | Matches the specified pattern to an object found in the same relative path of the target. |
static object | Matches the specified pattern to an object found in the same relative path of the target. |
static serialized | Matches any string-encoded JSON and applies the specified pattern after parsing it. |
static string | Matches targets according to a regular expression. |
static absent()
public static absent(): Matcher
Returns
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
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
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
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
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
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
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
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
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
Matches targets according to a regular expression.