1
1
/* eslint-env mocha */
2
2
3
3
import { expect } from 'chai'
4
- import { getNIPSubdomain , getUrlFromService , createHostForService } from '../service-host'
4
+ import { getNIPSubdomain , getUrlFromService , createHostForService , createUrlForService } from '../service-host'
5
5
6
6
describe ( 'service-host' , function ( ) {
7
7
@@ -20,13 +20,20 @@ describe('service-host', function () {
20
20
21
21
describe ( 'createHostForService' , function ( ) {
22
22
23
- it ( 'should return the correct url host for a service' , async function ( ) {
23
+ it ( 'should return the correct host for a service' , async function ( ) {
24
24
expect ( await createHostForService ( 'someservice' , 'mynavy' , '127.0.0.1' ) ) . to . equal ( 'someservice.mynavy.127.0.0.1.nip.io' )
25
25
expect ( await createHostForService ( 'someservice' , 'mynavy' , '192.168.1.10' ) ) . to . equal ( 'someservice.mynavy.192.168.1.10.nip.io' )
26
26
} )
27
27
28
28
} )
29
29
30
+ describe ( 'createUrlForService' , function ( ) {
31
+
32
+ it ( 'should return the correct url for a service' , async function ( ) {
33
+ expect ( await createUrlForService ( 'someservice' , 'mynavy' , '192.168.99.100' ) ) . to . equal ( 'http://someservice.mynavy.192.168.99.100.nip.io' )
34
+ } )
35
+ } )
36
+
30
37
describe ( 'getUrlFromService' , function ( ) {
31
38
32
39
it ( 'should extract the host from service ENV config' , function ( ) {
0 commit comments