File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { queries as supportedQueries } from './constants';
77// It works when running parcel in dev mode, but not in build mode. Seems to
88// have something to do with a core-js Map polyfill being used?
99// It's now loaded from unpkg.com via ./index.html
10- // import {getQueriesForElement, queries, logDOM} from " @testing-library/dom" ;
10+ //import { getQueriesForElement, queries, logDOM } from ' @testing-library/dom' ;
1111const {
1212 getQueriesForElement,
1313 queries,
@@ -53,8 +53,8 @@ function getLastExpression(code) {
5353 const minified = ( code || '' )
5454 // remove comments
5555 . replace ( / \/ \* [ \s \S ] * ?\* \/ | \/ \/ .* / g, '' )
56- // remove all white space
57- . replace ( / \s / g, '' ) ;
56+ // remove all white space outside quotes
57+ . replace ( / [ ] + (? = [ ^ " ' ` ] * (?: [ " ' ` ] [ ^ " ' ` ] * [ " ' ` ] [ ^ " ' ` ] * ) * $ ) / g, '' ) ;
5858
5959 const start = supportedQueries . reduce (
6060 ( idx , qry ) => Math . max ( idx , minified . lastIndexOf ( qry . method ) ) ,
You can’t perform that action at this time.
0 commit comments