import * as matchers from './matchers' ; import * as scripts from './utils' ; declare const utils ; declare global { namespace NodeJS { interface Global { utils : typeof scripts ; } } namespace jest { interface Matchers < R > { toMatchPath : InstanceType < typeof matchers . ToMatchPath > [ 'match' ] ; toMatchPathContaining : InstanceType < typeof matchers . ToMatchPathContaining > [ 'match' ] ; } interface Expect { toMatchPath : typeof matchers . toMatchPath ; toMatchPathContaining : typeof matchers . toMatchPathContaining ; } } } if ( expect ) { const extensions = Object . keys ( matchers ) . filter ( ( k ) => k . charAt ( 0 ) . toLocaleLowerCase ( ) === k . charAt ( 0 ) ) . reduce ( ( extension , key ) => { extension [ key ] = ( actual , ... expected ) => matchers [ key ] ( actual ) . match ( ... expected ) ; return extension ; } , { } ) ; expect . extend ( extensions ) ; global . utils = scripts ; } else { console . error ( "Unable to find Jest's global expect" ) ; }