Files
start-os/sdk/base/lib/test/util.getNetworkInterface.test.ts
Aiden McClelland 855c1f1b07 style(sdk): apply prettier with single quotes
Run prettier across sdk/base and sdk/package to apply the
standardized quote style (single quotes matching web).
2026-02-05 13:34:01 -07:00

21 lines
655 B
TypeScript

import { getHostname } from '../util/getServiceInterface'
describe('getHostname ', () => {
const inputToExpected = [
['http://localhost:3000', 'localhost'],
['http://localhost', 'localhost'],
['localhost', 'localhost'],
['http://127.0.0.1/', '127.0.0.1'],
['http://127.0.0.1/testing/1234?314345', '127.0.0.1'],
['127.0.0.1/', '127.0.0.1'],
['http://mail.google.com/', 'mail.google.com'],
['mail.google.com/', 'mail.google.com'],
]
for (const [input, expectValue] of inputToExpected) {
test(`should return ${expectValue} for ${input}`, () => {
expect(getHostname(input)).toEqual(expectValue)
})
}
})