We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b05ec44 commit 64dc781Copy full SHA for 64dc781
packages/mongodb-memory-server-core/src/util/__tests__/utils.test.ts
@@ -107,4 +107,14 @@ describe('utils', () => {
107
).rejects.toThrow(retError);
108
});
109
110
+
111
+ describe('getHost', () => {
112
+ it('should correctly extract host & port', () => {
113
+ expect(utils.getHost('mongodb://user:pass@localhost:port/authdb?queryoptions=1')).toEqual(
114
+ 'localhost:port'
115
+ );
116
+ expect(utils.getHost('mongodb://0.0.0.0:0000/')).toEqual('0.0.0.0:0000');
117
+ expect(utils.getHost('mongodb://user:pass@localhost:0000/')).toEqual('localhost:0000');
118
+ });
119
120
0 commit comments