@@ -43,65 +43,65 @@ describe('generate', () => {
4343 expect ( fileExists ( `${ OUTPUT_DIR } /${ serviceName } /${ serviceName } .d.ts` ) ) . toBe ( false ) ;
4444 } ) ;
4545
46- it . each ( [ 'hello_world' , 'example' ] ) (
47- 'should generate a bindgen with interface declaration' ,
48- async ( serviceName ) => {
49- const didFile = `${ TESTS_ASSETS_DIR } /${ serviceName } .did` ;
46+ it . each ( [
47+ 'hello_world' ,
48+ 'example' ,
49+ ] ) ( 'should generate a bindgen with interface declaration' , async ( serviceName ) => {
50+ const didFile = `${ TESTS_ASSETS_DIR } /${ serviceName } .did` ;
5051
51- await generate ( {
52- didFile,
53- outDir : OUTPUT_DIR ,
54- output : { actor : { interfaceFile : true } } ,
55- } ) ;
52+ await generate ( {
53+ didFile,
54+ outDir : OUTPUT_DIR ,
55+ output : { actor : { interfaceFile : true } } ,
56+ } ) ;
5657
57- await expectGeneratedOutput ( SNAPSHOTS_DIR , serviceName ) ;
58+ await expectGeneratedOutput ( SNAPSHOTS_DIR , serviceName ) ;
5859
59- const interfaceTs = await readFileFromOutput ( `${ serviceName } .d.ts` ) ;
60- await expect ( interfaceTs ) . toMatchFileSnapshot (
61- `${ SNAPSHOTS_DIR } /${ serviceName } /${ serviceName } .d.ts.snapshot` ,
62- ) ;
63- } ,
64- ) ;
60+ const interfaceTs = await readFileFromOutput ( `${ serviceName } .d.ts` ) ;
61+ await expect ( interfaceTs ) . toMatchFileSnapshot (
62+ `${ SNAPSHOTS_DIR } /${ serviceName } /${ serviceName } .d.ts.snapshot` ,
63+ ) ;
64+ } ) ;
6565
66- it . each ( [ 'hello_world' , 'example' ] ) (
67- 'should generate a bindgen with declarations only' ,
68- async ( serviceName ) => {
69- const didFile = `${ TESTS_ASSETS_DIR } /${ serviceName } .did` ;
66+ it . each ( [
67+ 'hello_world' ,
68+ 'example' ,
69+ ] ) ( 'should generate a bindgen with declarations only' , async ( serviceName ) => {
70+ const didFile = `${ TESTS_ASSETS_DIR } /${ serviceName } .did` ;
7071
71- await generate ( {
72- didFile,
73- outDir : OUTPUT_DIR ,
74- output : { actor : { disabled : true } } ,
75- } ) ;
72+ await generate ( {
73+ didFile,
74+ outDir : OUTPUT_DIR ,
75+ output : { actor : { disabled : true } } ,
76+ } ) ;
7677
77- await expectGeneratedDeclarations ( SNAPSHOTS_DIR , serviceName ) ;
78- expect ( fileExists ( `${ OUTPUT_DIR } /${ serviceName } /${ serviceName } .d.ts` ) ) . toBe ( false ) ;
79- expect ( fileExists ( `${ OUTPUT_DIR } /${ serviceName } /${ serviceName } .ts` ) ) . toBe ( false ) ;
80- } ,
81- ) ;
78+ await expectGeneratedDeclarations ( SNAPSHOTS_DIR , serviceName ) ;
79+ expect ( fileExists ( `${ OUTPUT_DIR } /${ serviceName } /${ serviceName } .d.ts` ) ) . toBe ( false ) ;
80+ expect ( fileExists ( `${ OUTPUT_DIR } /${ serviceName } /${ serviceName } .ts` ) ) . toBe ( false ) ;
81+ } ) ;
8282
83- it . each ( [ 'hello_world' , 'example' ] ) (
84- 'should ignore other options when generating a bindgen with actor disabled' ,
85- async ( serviceName ) => {
86- const didFile = `${ TESTS_ASSETS_DIR } /${ serviceName } .did` ;
83+ it . each ( [
84+ 'hello_world' ,
85+ 'example' ,
86+ ] ) ( 'should ignore other options when generating a bindgen with actor disabled' , async ( serviceName ) => {
87+ const didFile = `${ TESTS_ASSETS_DIR } /${ serviceName } .did` ;
8788
88- await generate ( {
89- didFile,
90- outDir : OUTPUT_DIR ,
91- output : {
92- actor : {
93- disabled : true ,
94- // @ts -expect-error - the interface does not allow this, but we want to test that it is ignored at runtime
95- interfaceFile : true ,
96- } ,
89+ await generate ( {
90+ didFile,
91+ outDir : OUTPUT_DIR ,
92+ output : {
93+ actor : {
94+ disabled : true ,
95+ // @ts -expect-error - the interface does not allow this, but we want to test that it is ignored at runtime
96+ interfaceFile : true ,
9797 } ,
98- } ) ;
98+ } ,
99+ } ) ;
99100
100- await expectGeneratedDeclarations ( SNAPSHOTS_DIR , serviceName ) ;
101- expect ( fileExists ( `${ OUTPUT_DIR } /${ serviceName } /${ serviceName } .d.ts` ) ) . toBe ( false ) ;
102- expect ( fileExists ( `${ OUTPUT_DIR } /${ serviceName } /${ serviceName } .ts` ) ) . toBe ( false ) ;
103- } ,
104- ) ;
101+ await expectGeneratedDeclarations ( SNAPSHOTS_DIR , serviceName ) ;
102+ expect ( fileExists ( `${ OUTPUT_DIR } /${ serviceName } /${ serviceName } .d.ts` ) ) . toBe ( false ) ;
103+ expect ( fileExists ( `${ OUTPUT_DIR } /${ serviceName } /${ serviceName } .ts` ) ) . toBe ( false ) ;
104+ } ) ;
105105
106106 it ( 'should preserve the .did file' , async ( ) => {
107107 const { readFile : realReadFile } =
0 commit comments