insomnia/app/backend/__tests__/dns.test.js

14 lines
376 B
JavaScript
Raw Normal View History

import * as dnsUtils from '../dns';
describe('swapHost()', () => {
it('succeed with localhost', async () => {
const ip = await dnsUtils.swapHost('http://localhost');
2016-10-26 20:30:31 +00:00
expect(ip).toEqual('http://[::1]/');
});
it('no-op on invalid', async () => {
const ip = await dnsUtils.swapHost('http://poooooooop');
expect(ip).toEqual('http://poooooooop');
});
});