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';
7
7
// It works when running parcel in dev mode, but not in build mode. Seems to
8
8
// have something to do with a core-js Map polyfill being used?
9
9
// 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' ;
11
11
const {
12
12
getQueriesForElement,
13
13
queries,
@@ -53,8 +53,8 @@ function getLastExpression(code) {
53
53
const minified = ( code || '' )
54
54
// remove comments
55
55
. replace ( / \/ \* [ \s \S ] * ?\* \/ | \/ \/ .* / g, '' )
56
- // remove all white space
57
- . replace ( / \s / g, '' ) ;
56
+ // remove all white space outside quotes
57
+ . replace ( / [ ] + (? = [ ^ " ' ` ] * (?: [ " ' ` ] [ ^ " ' ` ] * [ " ' ` ] [ ^ " ' ` ] * ) * $ ) / g, '' ) ;
58
58
59
59
const start = supportedQueries . reduce (
60
60
( idx , qry ) => Math . max ( idx , minified . lastIndexOf ( qry . method ) ) ,
You can’t perform that action at this time.
0 commit comments