Core Modules@serenity-js/assertionsExpectationsmatchesexternalmatches Callablematches(...answerableArguments: [expected: Answerable<RegExp>]): Expectation<string>Creates an expectation that is met when the actual string value matches the expected regular expression. Ensuring that a given string matches a regular expressionimport { actorCalled } from '@serenity-js/core'import { Ensure, includes } from '@serenity-js/assertions'await actorCalled('Ester').attemptsTo( Ensure.that('Hello World!', matches(/[Ww]orld/)),)Parametersexternalrest...answerableArguments: [expected: Answerable<RegExp>]Returns Expectation<string>
Creates an expectation that is met when the actual
string
value matches theexpected
regular expression.Ensuring that a given string matches a regular expression