nodejs-mozilla/test/parallel/test-whatwg-url-custom-href...

16 lines
304 B
JavaScript

'use strict';
// Tests below are not from WPT.
require('../common');
const assert = require('assert');
const ref = new URL('http://example.com/path');
const url = new URL('http://example.com/path');
assert.throws(() => {
url.href = '';
}, {
name: 'TypeError'
});
assert.deepStrictEqual(url, ref);