@@ -296,13 +296,29 @@ public void GenerateWithCustomFileNameSuffix(string suffix, bool isTypeScript)
296
296
Assert . That ( result . Files , Has . Count . EqualTo ( isTypeScript ? 3 : 2 ) ) ;
297
297
var fullSuffix = suffix + ( isTypeScript ? ".ts" : ".js" ) ;
298
298
Assert . That ( result . Files , Has . One . Matches < CodeGenFile > ( f => f . Name == $ "testApi{ fullSuffix } ") ) ;
299
- Assert . That ( result . Files , Has . One . Matches < CodeGenFile > ( f => f . Name == $ "testApi{ fullSuffix } ") ) ;
300
299
Assert . That ( result . Files , Has . One . Matches < CodeGenFile > ( f => f . Name == $ "testApiServer{ fullSuffix } ") ) ;
301
300
302
301
if ( isTypeScript )
303
302
Assert . That ( result . Files . SingleOrDefault ( f => f . Name == $ "testApiTypes{ fullSuffix } ") , Is . Not . Null ) ;
304
303
}
305
304
305
+ [ Test ]
306
+ public void GenerateWithCustomFileNameSuffix_TypeScriptFileNameReferencesCorrect ( )
307
+ {
308
+ const string definition = "service TestApi { }" ;
309
+ var parser = new FsdParser ( ) ;
310
+ var service = parser . ParseDefinition ( new ServiceDefinitionText ( "TestApi.fsd" , definition ) ) ;
311
+ var generator = new JavaScriptGenerator { GeneratorName = "JavaScriptGeneratorTests" , TypeScript = true , Express = true , FileNameSuffix = ".g" } ;
312
+ var result = generator . GenerateOutput ( service ) ;
313
+ Assert . That ( result , Is . Not . Null ) ;
314
+
315
+ var clientFile = result . Files . Single ( x => x . Name == "testApi.g.ts" ) ;
316
+ Assert . That ( clientFile . Text , Does . Contain ( "export * from './testApiTypes.g';" ) ) ;
317
+
318
+ var serverFile = result . Files . Single ( x => x . Name == "testApiServer.g.ts" ) ;
319
+ Assert . That ( serverFile . Text , Does . Contain ( "export * from './testApiTypes.g';" ) ) ;
320
+ }
321
+
306
322
private void ThrowsServiceDefinitionException ( string definition , string message )
307
323
{
308
324
var parser = new FsdParser ( ) ;
0 commit comments