1818
1919var assert = require ( 'assert' ) ;
2020var extend = require ( 'extend' ) ;
21- var format = require ( 'string-format-obj' ) ;
2221var proxyquire = require ( 'proxyquire' ) ;
2322
2423const common = require ( '@google-cloud/common-grpc' ) ;
@@ -41,11 +40,7 @@ describe('Bigtable/Cluster', function() {
4140 bigtable : { projectId : PROJECT_ID } ,
4241 } ;
4342
44- var CLUSTER_NAME = format ( '{instance}/clusters/{cluster}' , {
45- instance : INSTANCE . name ,
46- cluster : CLUSTER_ID ,
47- } ) ;
48-
43+ var CLUSTER_NAME = `${ INSTANCE . name } /clusters/${ CLUSTER_ID } ` ;
4944 var Cluster ;
5045 var cluster ;
5146
@@ -105,31 +100,22 @@ describe('Bigtable/Cluster', function() {
105100 var LOCATION = 'us-centralb-1' ;
106101
107102 it ( 'should format the location name' , function ( ) {
108- var expected = format ( 'projects/{project}/locations/{location}' , {
109- project : PROJECT_ID ,
110- location : LOCATION ,
111- } ) ;
112-
103+ var expected = `projects/${ PROJECT_ID } /locations/${ LOCATION } ` ;
113104 var formatted = Cluster . getLocation_ ( PROJECT_ID , LOCATION ) ;
114105 assert . strictEqual ( formatted , expected ) ;
115106 } ) ;
116107
117108 it ( 'should format the location name for project name with /' , function ( ) {
118109 var PROJECT_NAME = 'projects/grape-spaceship-123' ;
119- var expected = format ( 'projects/{project}/locations/{location}' , {
120- project : PROJECT_NAME . split ( '/' ) . pop ( ) ,
121- location : LOCATION ,
122- } ) ;
123-
110+ var expected = `projects/${ PROJECT_NAME . split (
111+ '/'
112+ ) . pop ( ) } /locations/${ LOCATION } `;
124113 var formatted = Cluster . getLocation_ ( PROJECT_NAME , LOCATION ) ;
125114 assert . strictEqual ( formatted , expected ) ;
126115 } ) ;
127116
128117 it ( 'should not re-format a complete location' , function ( ) {
129- var complete = format ( 'projects/p/locations/{location}' , {
130- location : LOCATION ,
131- } ) ;
132-
118+ var complete = `projects/p/locations/${ LOCATION } ` ;
133119 var formatted = Cluster . getLocation_ ( PROJECT_ID , complete ) ;
134120 assert . strictEqual ( formatted , complete ) ;
135121 } ) ;
0 commit comments