@@ -13,7 +13,7 @@ describe('/test/index.test.ts', () => {
13
13
14
14
compiler . compile ( ) ;
15
15
16
- expect ( existsSync ( join ( __dirname , './fixtures/common/hero.ts' ) ) ) . toBeTruthy ( ) ;
16
+ expect ( existsSync ( join ( __dirname , './fixtures/common/test/ hero.ts' ) ) ) . toBeTruthy ( ) ;
17
17
expect ( existsSync ( join ( __dirname , './fixtures/common/helloworld.ts' ) ) ) . toBeTruthy ( ) ;
18
18
expect ( existsSync ( join ( __dirname , './fixtures/common/math.ts' ) ) ) . toBeTruthy ( ) ;
19
19
@@ -32,7 +32,7 @@ describe('/test/index.test.ts', () => {
32
32
expect ( content . includes ( 'addMany(options?: grpc.IClientOptions): grpc.IClientWritableStreamService<AddArgs, Num>;' ) ) . toBeTruthy ( ) ;
33
33
expect ( content . includes ( 'addEmpty(options?: grpc.IClientOptions): grpc.IClientUnaryService<any, any>;' ) ) . toBeTruthy ( ) ;
34
34
35
- await remove ( join ( __dirname , './fixtures/common/hero.ts' ) ) ;
35
+ await remove ( join ( __dirname , './fixtures/common/test/ hero.ts' ) ) ;
36
36
await remove ( join ( __dirname , './fixtures/common/helloworld.ts' ) ) ;
37
37
await remove ( join ( __dirname , './fixtures/common/math.ts' ) ) ;
38
38
await remove ( join ( __dirname , './fixtures/common/hello_stream.ts' ) ) ;
@@ -55,6 +55,24 @@ describe('/test/index.test.ts', () => {
55
55
await remove ( join ( __dirname , './fixtures/common/domain' ) ) ;
56
56
} ) ;
57
57
58
+ it ( 'test generate ts interface to specified directory with reserve directory' , async ( ) => {
59
+ const compiler = new Compiler ( {
60
+ path : [ 'test/fixtures/common' ] ,
61
+ target : [ '.proto' ] ,
62
+ ignore : [ 'node_modules' , 'dist' ] ,
63
+ output : 'test/fixtures/common/domain' ,
64
+ reserve : true
65
+ } ) ;
66
+
67
+ compiler . compile ( ) ;
68
+
69
+ expect ( existsSync ( join ( __dirname , './fixtures/common/domain/test/hero.ts' ) ) ) . toBeTruthy ( ) ;
70
+ expect ( existsSync ( join ( __dirname , './fixtures/common/domain/helloworld.ts' ) ) ) . toBeTruthy ( ) ;
71
+ expect ( existsSync ( join ( __dirname , './fixtures/common/domain/math.ts' ) ) ) . toBeTruthy ( ) ;
72
+
73
+ await remove ( join ( __dirname , './fixtures/common/domain' ) ) ;
74
+ } ) ;
75
+
58
76
it ( 'test generate ts interface keep case' , async ( ) => {
59
77
const compiler = new Compiler ( {
60
78
path : [ 'test/fixtures/keep_case' ] ,
0 commit comments