insomnia/app/common/__tests__/dns.test.js
2016-11-09 21:56:23 -08:00

14 lines
376 B
JavaScript

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