Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 347547a

Browse filesBrowse files
jun-okaMyles Borins
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 <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ilkka Myller <ilkka.myller@nodefield.com> Reviewed-By: Franziska Hinkelmann <fhinkel@vt.edu>
1 parent bdb6cf9 commit 347547a
Copy full SHA for 347547a

File tree

Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-0
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-url.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-url.js
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,17 @@ var parseTests = {
157157
path: '/Y'
158158
},
159159

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.