0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-url-is-url-internal.js
Yagiz Nizipli 59220bb08a
test: move more url tests to node:test
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>
2024-09-13 00:29:55 +00:00

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);
});