parseUrl.spec.tsx 376 B

1234567891011
  1. import parseUrl from 'sentry/utils/url/parseUrl';
  2. describe('parseUrl', () => {
  3. it('should return a URL object when a valid string is passed', () => {
  4. expect(parseUrl('https://example.com')).toStrictEqual(expect.any(URL));
  5. });
  6. it('should return undefined, not throw, when an invalid string is passed', () => {
  7. expect(parseUrl('foo')).toBeUndefined();
  8. });
  9. });