Closed rendall closed 1 year ago
This test passes, asking it to strip authentication and protocol:
it('should strip authentication and protocol', () => {
expect(normalizeUrl('https://user:password@sindresorhus.com', {stripProtocol:true}))
.toBe('sindresorhus.com');
});
This is by design. I just forgot to document the behavior: https://github.com/sindresorhus/normalize-url/commit/2d0bafe20423c9424266b63e0b5086fc38364127
Also see: https://github.com/sindresorhus/normalize-url/releases/tag/v8.0.0
Understood. My comment was more about the documentation. I submitted PR #185 as a quick documentation fix to get it aligned with the behavior.
The documentation has these examples regarding
stripAuthentication
:However, those examples fail in (Jest) tests:
These tests do pass, however, if the protocol is included: