File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -115,18 +115,20 @@ testData.forEach((item) => {
115
115
assert . ifError ( err ) ;
116
116
117
117
const actual = output . replace ( spaces , '' ) ;
118
+ const scriptDomain = 'google-analytics.com' ;
118
119
// Assert that the input stripped of all whitespace contains the
119
120
// expected list
120
121
assert ( actual . includes ( expected ) ) ;
121
122
122
123
// Testing the insertion of Google Analytics script when
123
124
// an analytics id is provided. Should not be present by default
124
125
if ( includeAnalytics ) {
125
- assert ( actual . includes ( 'google-analytics.com' ) ,
126
- ' Google Analytics script was not present' ) ;
126
+ assert ( actual . includes ( scriptDomain ) ,
127
+ ` Google Analytics script was not present in " ${ actual } "` ) ;
127
128
} else {
128
- assert . strictEqual ( actual . includes ( 'google-analytics.com' ) , false ,
129
- 'Google Analytics script was present' ) ;
129
+ assert . strictEqual ( actual . includes ( scriptDomain ) , false ,
130
+ 'Google Analytics script was present in ' +
131
+ `"${ actual } "` ) ;
130
132
}
131
133
} ) ) ;
132
134
} ) ) ;
You can’t perform that action at this time.
0 commit comments