Skip to content

Commit

Permalink
test: test resolveObject with an empty path
Browse files Browse the repository at this point in the history
Add a case to test an URL object that has no path at all
for `url.resolveObject`.

PR-URL: nodejs#11811
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
watilde committed Mar 14, 2017
1 parent 879d666 commit 92bcc13
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/parallel/test-url-relative.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ const relativeTests2 = [
['https://example.com/foo',
'https://user:password@example.com',
'https://user:password@example.com/foo'],

// No path at all
['#hash1', '#hash2', '#hash1']
];
relativeTests2.forEach(function(relativeTest) {
const a = url.resolve(relativeTest[1], relativeTest[0]);
Expand Down

0 comments on commit 92bcc13

Please sign in to comment.