Comparing version 3.0.1 to 3.0.2
@@ -1748,5 +1748,22 @@ 'use strict'; | ||
ps = _context31.sent; | ||
return _context31.abrupt('return', (0, _serviceHost.getUrlFromService)(ps.pop())); | ||
_context31.t1 = (0, _serviceHost.getUrlFromService)(ps.pop()); | ||
case 7: | ||
if (_context31.t1) { | ||
_context31.next = 14; | ||
break; | ||
} | ||
_context31.t2 = service; | ||
_context31.t3 = this.normalisedName; | ||
_context31.next = 12; | ||
return this.externalIP(); | ||
case 12: | ||
_context31.t4 = _context31.sent; | ||
_context31.t1 = (0, _serviceHost.createUrlForService)(_context31.t2, _context31.t3, _context31.t4); | ||
case 14: | ||
return _context31.abrupt('return', _context31.t1); | ||
case 15: | ||
case 'end': | ||
@@ -1753,0 +1770,0 @@ return _context31.stop(); |
@@ -67,3 +67,3 @@ 'use strict'; | ||
it('should return the correct url host for a service', (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3() { | ||
it('should return the correct host for a service', (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3() { | ||
return _regenerator2.default.wrap(function _callee3$(_context3) { | ||
@@ -95,2 +95,25 @@ while (1) { | ||
describe('createUrlForService', function () { | ||
it('should return the correct url for a service', (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee4() { | ||
return _regenerator2.default.wrap(function _callee4$(_context4) { | ||
while (1) { | ||
switch (_context4.prev = _context4.next) { | ||
case 0: | ||
_context4.next = 2; | ||
return (0, _serviceHost.createUrlForService)('someservice', 'mynavy', '192.168.99.100'); | ||
case 2: | ||
_context4.t0 = _context4.sent; | ||
(0, _chai.expect)(_context4.t0).to.equal('http://someservice.mynavy.192.168.99.100.nip.io'); | ||
case 4: | ||
case 'end': | ||
return _context4.stop(); | ||
} | ||
} | ||
}, _callee4, this); | ||
}))); | ||
}); | ||
describe('getUrlFromService', function () { | ||
@@ -97,0 +120,0 @@ |
@@ -6,3 +6,3 @@ 'use strict'; | ||
}); | ||
exports.createHostForService = exports.getNIPSubdomain = undefined; | ||
exports.createUrlForService = exports.createHostForService = exports.getNIPSubdomain = undefined; | ||
@@ -87,2 +87,28 @@ var _getIterator2 = require('babel-runtime/core-js/get-iterator'); | ||
var createUrlForService = exports.createUrlForService = function () { | ||
var _ref3 = (0, _asyncToGenerator3.default)(_regenerator2.default.mark(function _callee3(service, navyNormalisedName, externalIP) { | ||
return _regenerator2.default.wrap(function _callee3$(_context3) { | ||
while (1) { | ||
switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_context3.next = 2; | ||
return createHostForService(service, navyNormalisedName, externalIP); | ||
case 2: | ||
_context3.t0 = _context3.sent; | ||
return _context3.abrupt('return', 'http://' + _context3.t0); | ||
case 4: | ||
case 'end': | ||
return _context3.stop(); | ||
} | ||
} | ||
}, _callee3, this); | ||
})); | ||
return function createUrlForService(_x5, _x6, _x7) { | ||
return _ref3.apply(this, arguments); | ||
}; | ||
}(); | ||
exports.getUrlFromService = getUrlFromService; | ||
@@ -89,0 +115,0 @@ |
{ | ||
"name": "navy", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "Quick and powerful development environments using Docker and Docker Compose", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
275488
6678