Fixed comparison between URL objects

* Fixes #1866
This commit is contained in:
Steve Gravrock
2020-11-21 13:35:10 -08:00
parent 88de272c89
commit 89331bb1bb
8 changed files with 106 additions and 0 deletions

View File

@@ -62,4 +62,17 @@ describe('base helpers', function() {
expect(jasmineUnderTest.isSet({})).toBe(false);
});
});
describe('isURL', function() {
it('returns true when the object is a URL', function() {
jasmine.getEnv().requireUrls();
// eslint-disable-next-line compat/compat
expect(jasmineUnderTest.isURL(new URL('http://localhost/'))).toBe(true);
});
it('returns false when the object is not a URL', function() {
jasmine.getEnv().requireUrls();
expect(jasmineUnderTest.isURL({})).toBe(false);
});
});
});