| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 342ac9f commit ab7f43a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -103,18 +103,20 @@ testData.forEach((item) => { | |||
| 103 | 103 | assert.ifError(err); | |
| 104 | 104 | ||
| 105 | 105 | const actual = output.replace(spaces, ''); | |
| 106 | + const scriptDomain = 'google-analytics.com'; | ||
| 106 | 107 | // Assert that the input stripped of all whitespace contains the | |
| 107 | 108 | // expected list | |
| 108 | 109 | assert(actual.includes(expected)); | |
| 109 | 110 | ||
| 110 | 111 | // Testing the insertion of Google Analytics script when | |
| 111 | 112 | // an analytics id is provided. Should not be present by default | |
| 112 | 113 | if (includeAnalytics) { | |
| 113 | - assert(actual.includes('google-analytics.com'), | ||
| 114 | - 'Google Analytics script was not present'); | ||
| 114 | + assert(actual.includes(scriptDomain), | ||
| 115 | + `Google Analytics script was not present in "${actual}"`); | ||
| 115 | 116 | } else { | |
| 116 | - assert.strictEqual(actual.includes('google-analytics.com'), false, | ||
| 117 | - 'Google Analytics script was present'); | ||
| 117 | + assert.strictEqual(actual.includes(scriptDomain), false, | ||
| 118 | + 'Google Analytics script was present in ' + | ||
| 119 | + `"${actual}"`); | ||
| 118 | 120 | } | |
| 119 | 121 | })); | |
| 120 | 122 | })); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments