mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 15:30:56 +01:00
38 lines
696 B
JavaScript
38 lines
696 B
JavaScript
|
'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
|
||
|
}`
|
||
|
);
|