mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
59220bb08a
PR-URL: https://github.com/nodejs/node/pull/54636 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
20 lines
516 B
JavaScript
20 lines
516 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
|
|
require('../common');
|
|
|
|
const { URL, parse } = require('node:url');
|
|
const assert = require('node:assert');
|
|
const { isURL } = require('internal/url');
|
|
const { test } = require('node:test');
|
|
|
|
test('isURL', () => {
|
|
assert.strictEqual(isURL(new URL('https://www.nodejs.org')), true);
|
|
assert.strictEqual(isURL(parse('https://www.nodejs.org')), false);
|
|
assert.strictEqual(isURL({
|
|
href: 'https://www.nodejs.org',
|
|
protocol: 'https:',
|
|
path: '/',
|
|
}), false);
|
|
});
|