mirror of https://github.com/lukechilds/node.git
Browse Source
See: https://url.spec.whatwg.org/#dom-url-origin Also moves the tests for origins to the parsing tests since now URL#origin matches the test cases by default. PR-URL: https://github.com/nodejs/node/pull/10552 Reviewed-By: James M Snell <jasnell@gmail.com>v7.x
Joyee Cheung
8 years ago
committed by
Italo A. Casas
3 changed files with 25 additions and 38 deletions
@ -1,19 +0,0 @@ |
|||
'use strict'; |
|||
|
|||
const common = require('../common'); |
|||
|
|||
const originFor = require('url').originFor; |
|||
const path = require('path'); |
|||
const assert = require('assert'); |
|||
const tests = require(path.join(common.fixturesDir, 'url-tests.json')); |
|||
|
|||
for (const test of tests) { |
|||
if (typeof test === 'string') |
|||
continue; |
|||
|
|||
if (test.origin) { |
|||
const origin = originFor(test.input, test.base); |
|||
// Pass true to origin.toString() to enable unicode serialization.
|
|||
assert.strictEqual(origin.toString(true), test.origin); |
|||
} |
|||
} |
Loading…
Reference in new issue