@@ -119,26 +119,35 @@ test('forceHttps option', t => {
119119
120120test ( 'removeTrailingSlash option' , t => {
121121 const options = { removeTrailingSlash : false } ;
122+ t . is ( normalizeUrl ( 'http://sindresorhus.com' ) , 'http://sindresorhus.com' ) ;
122123 t . is ( normalizeUrl ( 'http://sindresorhus.com/' ) , 'http://sindresorhus.com' ) ;
124+ t . is ( normalizeUrl ( 'http://sindresorhus.com' , options ) , 'http://sindresorhus.com' ) ;
123125 t . is ( normalizeUrl ( 'http://sindresorhus.com/' , options ) , 'http://sindresorhus.com' ) ;
126+ t . is ( normalizeUrl ( 'http://sindresorhus.com/redirect' ) , 'http://sindresorhus.com/redirect' ) ;
124127 t . is ( normalizeUrl ( 'http://sindresorhus.com/redirect/' ) , 'http://sindresorhus.com/redirect' ) ;
125128 t . is ( normalizeUrl ( 'http://sindresorhus.com/redirect/' , options ) , 'http://sindresorhus.com/redirect/' ) ;
129+ t . is ( normalizeUrl ( 'http://sindresorhus.com/redirect/' , options ) , 'http://sindresorhus.com/redirect/' ) ;
130+ t . is ( normalizeUrl ( 'http://sindresorhus.com/#/' ) , 'http://sindresorhus.com/#/' ) ;
126131 t . is ( normalizeUrl ( 'http://sindresorhus.com/#/' , options ) , 'http://sindresorhus.com/#/' ) ;
127132 t . is ( normalizeUrl ( 'http://sindresorhus.com/?unicorns=true' ) , 'http://sindresorhus.com/?unicorns=true' ) ;
128133 t . is ( normalizeUrl ( 'http://sindresorhus.com/?unicorns=true' , options ) , 'http://sindresorhus.com/?unicorns=true' ) ;
129134} ) ;
130135
131136test ( 'removeSingleSlash option' , t => {
132137 const options = { removeSingleSlash : false } ;
138+ t . is ( normalizeUrl ( 'https://sindresorhus.com' , options ) , 'https://sindresorhus.com' ) ;
133139 t . is ( normalizeUrl ( 'https://sindresorhus.com/' , options ) , 'https://sindresorhus.com/' ) ;
140+ t . is ( normalizeUrl ( 'https://sindresorhus.com/redirect' , options ) , 'https://sindresorhus.com/redirect' ) ;
134141 t . is ( normalizeUrl ( 'https://sindresorhus.com/redirect/' , options ) , 'https://sindresorhus.com/redirect' ) ;
135142 t . is ( normalizeUrl ( 'https://sindresorhus.com/#/' , options ) , 'https://sindresorhus.com/#/' ) ;
136143 t . is ( normalizeUrl ( 'https://sindresorhus.com/?unicorns=true' , options ) , 'https://sindresorhus.com/?unicorns=true' ) ;
137144} ) ;
138145
139146test ( 'removeSingleSlash option combined with removeTrailingSlash option' , t => {
140147 const options = { removeTrailingSlash : false , removeSingleSlash : false } ;
148+ t . is ( normalizeUrl ( 'https://sindresorhus.com' , options ) , 'https://sindresorhus.com' ) ;
141149 t . is ( normalizeUrl ( 'https://sindresorhus.com/' , options ) , 'https://sindresorhus.com/' ) ;
150+ t . is ( normalizeUrl ( 'https://sindresorhus.com/redirect' , options ) , 'https://sindresorhus.com/redirect' ) ;
142151 t . is ( normalizeUrl ( 'https://sindresorhus.com/redirect/' , options ) , 'https://sindresorhus.com/redirect/' ) ;
143152 t . is ( normalizeUrl ( 'https://sindresorhus.com/#/' , options ) , 'https://sindresorhus.com/#/' ) ;
144153 t . is ( normalizeUrl ( 'https://sindresorhus.com/?unicorns=true' , options ) , 'https://sindresorhus.com/?unicorns=true' ) ;
0 commit comments