Add is.urlInstance

This commit is contained in:
Artur 2018-07-09 01:35:26 +03:00
parent 2dbf247fc0
commit 7e71742a0f
2 changed files with 13 additions and 0 deletions

View file

@ -3,6 +3,7 @@ import net from 'net';
import Stream from 'stream';
import util from 'util';
import tempy from 'tempy';
import {URL} from 'url';
import test, {TestContext, Context} from 'ava';
import {JSDOM} from 'jsdom';
import {Subject, Observable} from 'rxjs';
@ -534,6 +535,16 @@ test('is.directInstanceOf', t => {
t.false(m.directInstanceOf(errorSubclass, Error));
});
test('is.urlInstance', t => {
const url = new URL('https://google.com');
t.true(m.urlInstance(url));
t.false(m.urlInstance({}));
t.false(m.urlInstance(undefined));
t.false(m.urlInstance(null));
});
test('is.truthy', t => {
t.true(m.truthy('unicorn'));
t.true(m.truthy('🦄'));