import path from 'path' ; import { AsymmetricMatcher } from './AsymmetricMatcher' ; export class ToMatchPathContaining extends AsymmetricMatcher < string > { constructor ( actual , inverse = false ) { super ( actual ) ; this . inverse = inverse ; } asymmetricMatch ( expected ) { return this . actual . includes ( path . normalize ( expected ) ) ; } match ( expected ) { const pass = this . asymmetricMatch ( expected ) ; return { pass , message : pass ? this . passMessage ( this . actual , expected ) : this . failMessage ( this . actual , expected ) , } ; } method ( ) { return 'toMatchPathContaining' ; } toString ( ) { return 'ToMatchPathContaining' ; } } export default ( actual ) : ToMatchPathContaining => new ToMatchPathContaining ( actual ) ;