mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-16 02:11:28 +00:00
test: restore config command host mock
This commit is contained in:
@@ -88,6 +88,17 @@ beforeEach(() => {
|
||||
}));
|
||||
|
||||
mock.module('../../../src/commands/config-dashboard-host', () => ({
|
||||
normalizeDashboardHost: (host: string | undefined) => {
|
||||
if (!host) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (host.startsWith('[') && host.endsWith(']') && host.includes(':')) {
|
||||
return host.slice(1, -1);
|
||||
}
|
||||
|
||||
return host;
|
||||
},
|
||||
isLoopbackHost: (host: string) =>
|
||||
['localhost', '127.0.0.1', '::1', '[::1]'].includes(host.trim().toLowerCase()),
|
||||
isWildcardHost: (host: string) => ['0.0.0.0', '::', '[::]'].includes(host.trim().toLowerCase()),
|
||||
|
||||
Reference in New Issue
Block a user