-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
url: add inspect function to TupleOrigin
This adds a simple inspect function the the TupleOrigin class. This adds tests for the newly added inspect function in the TupleOrigin class. PR-URL: #10039 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
- Loading branch information
1 parent
6963e8a
commit 24482d0
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
'use strict'; | ||
|
||
require('../common'); | ||
const assert = require('assert'); | ||
const inspect = require('util').inspect; | ||
const URL = require('url').URL; | ||
|
||
assert.strictEqual( | ||
inspect(URL.originFor('http://test.com:8000')), | ||
`TupleOrigin { | ||
scheme: http, | ||
host: test.com, | ||
port: 8000, | ||
domain: null | ||
}` | ||
); | ||
|
||
assert.strictEqual( | ||
inspect(URL.originFor('http://test.com')), | ||
`TupleOrigin { | ||
scheme: http, | ||
host: test.com, | ||
port: undefined, | ||
domain: null | ||
}` | ||
); | ||
|
||
|
||
assert.strictEqual( | ||
inspect(URL.originFor('https://test.com')), | ||
`TupleOrigin { | ||
scheme: https, | ||
host: test.com, | ||
port: undefined, | ||
domain: null | ||
}` | ||
); |