Skip to content

Commit cad2a2f

Browse files
jun-okafhinkel
authored andcommitted
test: expand test coverage for url.js
Currently, line 156 of lib/url.js is not reachable from test-url because there is no example URL which has a white space in the front of the url. I added one example which can reach that line. PR-URL: #8859 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ilkka Myller <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]>
1 parent 039f0c3 commit cad2a2f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/parallel/test-url.js

+11
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,17 @@ var parseTests = {
158158
path: '/Y'
159159
},
160160

161+
// whitespace in the front
162+
' http://www.example.com/': {
163+
href: 'http://www.example.com/',
164+
protocol: 'http:',
165+
slashes: true,
166+
host: 'www.example.com',
167+
hostname: 'www.example.com',
168+
pathname: '/',
169+
path: '/'
170+
},
171+
161172
// + not an invalid host character
162173
// per https://url.spec.whatwg.org/#host-parsing
163174
'http://x.y.com+a/b/c': {

0 commit comments

Comments
 (0)