@@ -22,7 +22,7 @@ const remark2rehype = require('remark-rehype');
22
22
const raw = require ( 'rehype-raw' ) ;
23
23
const htmlStringify = require ( 'rehype-stringify' ) ;
24
24
25
- function toHTML ( { input, filename, nodeVersion, analytics } , cb ) {
25
+ function toHTML ( { input, filename, nodeVersion } , cb ) {
26
26
const content = unified ( )
27
27
. use ( markdown )
28
28
. use ( html . firstHeader )
@@ -35,7 +35,7 @@ function toHTML({ input, filename, nodeVersion, analytics }, cb) {
35
35
. processSync ( input ) ;
36
36
37
37
html . toHTML (
38
- { input, content, filename, nodeVersion, analytics } ,
38
+ { input, content, filename, nodeVersion } ,
39
39
cb
40
40
) ;
41
41
}
@@ -94,16 +94,14 @@ const testData = [
94
94
file : fixtures . path ( 'sample_document.md' ) ,
95
95
html : '<ol><li>fish</li><li>fish</li></ol>' +
96
96
'<ul><li>Red fish</li><li>Blue fish</li></ul>' ,
97
- analyticsId : 'UA-67020396-1'
98
97
} ,
99
98
] ;
100
99
101
100
const spaces = / \s / g;
102
101
103
- testData . forEach ( ( { file, html, analyticsId } ) => {
102
+ testData . forEach ( ( { file, html } ) => {
104
103
// Normalize expected data by stripping whitespace.
105
104
const expected = html . replace ( spaces , '' ) ;
106
- const includeAnalytics = typeof analyticsId !== 'undefined' ;
107
105
108
106
readFile ( file , 'utf8' , common . mustCall ( ( err , input ) => {
109
107
assert . ifError ( err ) ;
@@ -112,7 +110,6 @@ testData.forEach(({ file, html, analyticsId }) => {
112
110
input : input ,
113
111
filename : 'foo' ,
114
112
nodeVersion : process . version ,
115
- analytics : analyticsId ,
116
113
} ,
117
114
common . mustCall ( ( err , output ) => {
118
115
assert . ifError ( err ) ;
@@ -121,18 +118,6 @@ testData.forEach(({ file, html, analyticsId }) => {
121
118
// Assert that the input stripped of all whitespace contains the
122
119
// expected markup.
123
120
assert ( actual . includes ( expected ) ) ;
124
-
125
- // Testing the insertion of Google Analytics script when
126
- // an analytics id is provided. Should not be present by default.
127
- const scriptDomain = 'google-analytics.com' ;
128
- if ( includeAnalytics ) {
129
- assert ( actual . includes ( scriptDomain ) ,
130
- `Google Analytics script was not present in "${ actual } "` ) ;
131
- } else {
132
- assert . strictEqual ( actual . includes ( scriptDomain ) , false ,
133
- 'Google Analytics script was present in ' +
134
- `"${ actual } "` ) ;
135
- }
136
121
} )
137
122
) ;
138
123
} ) ) ;
0 commit comments