import { expect } from 'chai' ; export function matchCSSMatchers ( chai , util ) { const { flag } = util ; chai . Assertion . addMethod ( 'matchCSS' , function ( css ) { let element = flag ( this , 'object' ) ; if ( ! Array . isArray ( css ) ) { css = [ css ] ; } if ( ! Array . isArray ( element ) ) { element = [ element ] ; } expect ( element . length ) . to . equal ( css . length ) ; css . forEach ( ( chunk , index ) => expect ( element [ index ] ) . to . eql ( chunk ) ) ; } ) ; }