@@ -22,7 +22,7 @@ const remark2rehype = require('remark-rehype');
2222const raw = require ( 'rehype-raw' ) ;
2323const htmlStringify = require ( 'rehype-stringify' ) ;
2424
25- function toHTML ( { input, filename, nodeVersion, analytics } , cb ) {
25+ function toHTML ( { input, filename, nodeVersion } , cb ) {
2626 const content = unified ( )
2727 . use ( markdown )
2828 . use ( html . firstHeader )
@@ -35,7 +35,7 @@ function toHTML({ input, filename, nodeVersion, analytics }, cb) {
3535 . processSync ( input ) ;
3636
3737 html . toHTML (
38- { input, content, filename, nodeVersion, analytics } ,
38+ { input, content, filename, nodeVersion } ,
3939 cb
4040 ) ;
4141}
@@ -94,16 +94,14 @@ const testData = [
9494 file : fixtures . path ( 'sample_document.md' ) ,
9595 html : '<ol><li>fish</li><li>fish</li></ol>' +
9696 '<ul><li>Red fish</li><li>Blue fish</li></ul>' ,
97- analyticsId : 'UA-67020396-1'
9897 } ,
9998] ;
10099
101100const spaces = / \s / g;
102101
103- testData . forEach ( ( { file, html, analyticsId } ) => {
102+ testData . forEach ( ( { file, html } ) => {
104103 // Normalize expected data by stripping whitespace.
105104 const expected = html . replace ( spaces , '' ) ;
106- const includeAnalytics = typeof analyticsId !== 'undefined' ;
107105
108106 readFile ( file , 'utf8' , common . mustCall ( ( err , input ) => {
109107 assert . ifError ( err ) ;
@@ -112,7 +110,6 @@ testData.forEach(({ file, html, analyticsId }) => {
112110 input : input ,
113111 filename : 'foo' ,
114112 nodeVersion : process . version ,
115- analytics : analyticsId ,
116113 } ,
117114 common . mustCall ( ( err , output ) => {
118115 assert . ifError ( err ) ;
@@ -121,18 +118,6 @@ testData.forEach(({ file, html, analyticsId }) => {
121118 // Assert that the input stripped of all whitespace contains the
122119 // expected markup.
123120 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- }
136121 } )
137122 ) ;
138123 } ) ) ;
0 commit comments