File tree Expand file tree Collapse file tree 3 files changed +17
-5
lines changed
Expand file tree Collapse file tree 3 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 66 strategy :
77 matrix :
88 node-version :
9+ - 20
910 - 18
1011 - 14
1112 - 10
12- - 6
1313 name : Node ${{ matrix.node-version }} sample
1414 steps :
1515 - uses : actions/checkout@v3
Original file line number Diff line number Diff line change @@ -31,11 +31,12 @@ const Task = class {
3131
3232 async normalizeParams ( params ) {
3333 const result = Object . assign ( { } , params , this . defaultParams ) ;
34+ const fileParams = Object . keys ( params ) . filter ( key => key . endsWith ( 'File' ) && key !== 'StoreFile' ) ;
3435
35- if ( params . File ) {
36- const file = await params . File ;
37- result . File = await buildFileParam ( this . api , file ) ;
38- }
36+ await Promise . all ( fileParams . map ( async ( key ) => {
37+ const file = await params [ key ] ;
38+ result [ key ] = await buildFileParam ( this . api , file ) ;
39+ } ) ) ;
3940
4041 if ( params . Files ) {
4142 const files = await normalizeFilesParam ( params . Files ) ;
Original file line number Diff line number Diff line change @@ -119,6 +119,17 @@ describe('ConvertAPI', () => {
119119 expect ( result . file . url ) . to . be . a ( 'string' ) ;
120120 } ) ;
121121
122+ it ( 'should compare files' , async ( ) => {
123+ const params = {
124+ File : './examples/files/test.docx' ,
125+ CompareFile : './examples/files/test.docx' ,
126+ } ;
127+
128+ const result = await api . convert ( 'compare' , params ) ;
129+
130+ expect ( result . file . url ) . to . be . a ( 'string' ) ;
131+ } ) ;
132+
122133 it ( 'should handle api errors' , ( ) => {
123134 const params = { Url : 'https://www.w3.org/TR/PNG/iso_8859-1.txt' } ;
124135
You can’t perform that action at this time.
0 commit comments