@@ -59,35 +59,26 @@ describe('FilesRepository', () => {
5959 // Uploading test file 1 with some categories
6060 const uploadFileResponse = await uploadFileViaApi ( testDatasetIds . numericId , testTextFile1Name , {
6161 categories : [ testCategoryName ]
62+ } ) . catch ( ( ) => {
63+ throw new Error ( `Tests beforeAll(): Error while uploading file ${ testTextFile1Name } ` )
6264 } )
63- . then ( )
64- . catch ( ( e ) => {
65- console . log ( e )
66- throw new Error ( `Tests beforeAll(): Error while uploading file ${ testTextFile1Name } ` )
67- } )
6865 // Uploading test file 2
69- await uploadFileViaApi ( testDatasetIds . numericId , testTextFile2Name )
70- . then ( )
71- . catch ( ( e ) => {
72- console . log ( e )
73- throw new Error ( `Tests beforeAll(): Error while uploading file ${ testTextFile2Name } ` )
74- } )
66+ await uploadFileViaApi ( testDatasetIds . numericId , testTextFile2Name ) . catch ( ( ) => {
67+ throw new Error ( `Tests beforeAll(): Error while uploading file ${ testTextFile2Name } ` )
68+ } )
7569 // Uploading test file 3
76- await uploadFileViaApi ( testDatasetIds . numericId , testTextFile3Name )
77- . then ( )
78- . catch ( ( e ) => {
79- console . log ( e )
80- throw new Error ( `Tests beforeAll(): Error while uploading file ${ testTextFile3Name } ` )
81- } )
70+ await uploadFileViaApi ( testDatasetIds . numericId , testTextFile3Name ) . catch ( ( ) => {
71+ throw new Error ( `Tests beforeAll(): Error while uploading file ${ testTextFile3Name } ` )
72+ } )
8273 // Uploading test file 4
83- await uploadFileViaApi ( testDatasetIds . numericId , testTabFile4Name )
84- . then ( )
85- . catch ( ( e ) => {
86- console . log ( e )
87- throw new Error ( `Tests beforeAll(): Error while uploading file ${ testTabFile4Name } ` )
88- } )
74+ await uploadFileViaApi ( testDatasetIds . numericId , testTabFile4Name ) . catch ( ( ) => {
75+ throw new Error ( `Tests beforeAll(): Error while uploading file ${ testTabFile4Name } ` )
76+ } )
8977 // Registering test file 1
90- await registerFileViaApi ( uploadFileResponse . data . data . files [ 0 ] . dataFile . id )
78+
79+ await registerFileViaApi ( uploadFileResponse . data . data . files [ 0 ] . dataFile . id ) . catch ( ( ) => {
80+ throw new Error ( `Tests beforeAll(): Error while registering file ${ testTextFile1Name } ` )
81+ } )
9182 const filesSubset = await sut . getDatasetFiles (
9283 testDatasetIds . numericId ,
9384 latestDatasetVersionId ,
@@ -544,23 +535,17 @@ describe('FilesRepository', () => {
544535 } )
545536
546537 test ( 'should return citation when dataset is deaccessioned' , async ( ) => {
547- await publishDatasetViaApi ( testDatasetIds . numericId )
548- . then ( )
549- . catch ( ( ) => {
550- throw new Error ( 'Error while publishing test Dataset' )
551- } )
552-
553- await waitForNoLocks ( testDatasetIds . numericId , 10 )
554- . then ( )
555- . catch ( ( ) => {
556- throw new Error ( 'Error while waiting for no locks' )
557- } )
558-
559- await deaccessionDatasetViaApi ( testDatasetIds . numericId , '1.0' )
560- . then ( )
561- . catch ( ( ) => {
562- throw new Error ( 'Error while deaccessioning test Dataset' )
563- } )
538+ await publishDatasetViaApi ( testDatasetIds . numericId ) . catch ( ( ) => {
539+ throw new Error ( 'Error while publishing test Dataset' )
540+ } )
541+
542+ await waitForNoLocks ( testDatasetIds . numericId , 10 ) . catch ( ( ) => {
543+ throw new Error ( 'Error while waiting for no locks' )
544+ } )
545+
546+ await deaccessionDatasetViaApi ( testDatasetIds . numericId , '1.0' ) . catch ( ( ) => {
547+ throw new Error ( 'Error while deaccessioning test Dataset' )
548+ } )
564549
565550 const actualFileCitation = await sut . getFileCitation (
566551 testFileId ,
0 commit comments