aws-cdk-lib.assertions.MatchFailure

interface MatchFailure

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

Match failure details.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { assertions } from 'aws-cdk-lib';

declare const matcher: assertions.Matcher;
const matchFailure: assertions.MatchFailure = {
  matcher: matcher,
  message: 'message',
  path: ['path'],

  // the properties below are optional
  cost: 123,
};

Properties

NameTypeDescription
matcherMatcherThe matcher that had the failure.
messagestringFailure message.
pathstring[]The relative path in the target where the failure occurred.
cost?numberThe cost of this particular mismatch.

matcher

Type: Matcher

The matcher that had the failure.


message

Type: string

Failure message.


path

Type: string[]

The relative path in the target where the failure occurred.

If the failure occurred at root of the match tree, set the path to an empty list. If it occurs in the 5th index of an array nested within the 'foo' key of an object, set the path as ['/foo', '[5]'].


cost?

Type: number (optional, default: 1)

The cost of this particular mismatch.