You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
normalizeUrl › should strip authentication part of the URL by default
Expected: "https://sindresorhus.com"
Received: "user:[email protected]"
24 | it('should strip authentication part of the URL by default', () => {
> 25 | expect(normalizeUrl('user:[email protected]')).toBe('https://sindresorhus.com');| ^
26 | });
at Object.<anonymous> (src/tests/backend/normalizeUrl.test.ts:25:60)
● normalizeUrl › should strip authentication part of the URL if stripAuthentication is true
Expected: "https://sindresorhus.com"
Received: "user:[email protected]"
28 | it('should strip authentication part of the URL if stripAuthentication is true', () => {
> 29 | expect(normalizeUrl('user:[email protected]', { stripAuthentication: true })).toBe('https://sindresorhus.com');| ^
30 | });
at Object.<anonymous> (src/tests/backend/normalizeUrl.test.ts:29:91)
These tests do pass, however, if the protocol is included:
it('should strip authentication part of the URL by default',()=>{expect(normalizeUrl('https://user:[email protected]')).toBe('https://sindresorhus.com');});it('should strip authentication part of the URL if stripAuthentication is true',()=>{expect(normalizeUrl('https://user:[email protected]',{stripAuthentication: true})).toBe('https://sindresorhus.com');});it('should not strip authentication if stripAuthentication is false',()=>{expect(normalizeUrl('https://user:[email protected]',{stripAuthentication: false})).toBe('https://user:[email protected]');});
The text was updated successfully, but these errors were encountered:
The documentation has these examples regarding
stripAuthentication
:However, those examples fail in (Jest) tests:
These tests do pass, however, if the protocol is included:
The text was updated successfully, but these errors were encountered: