@@ -849,10 +849,11 @@ describe('FilesRepository', () => {
849849 try {
850850 deleFileTestDatasetIds = await createDataset . execute ( TestConstants . TEST_NEW_DATASET_DTO )
851851 } catch ( error ) {
852- throw new Error ( 'Tests beforeEach (): Error while creating test dataset' )
852+ throw new Error ( 'Tests beforeAll (): Error while creating test dataset' )
853853 }
854+
854855 await uploadFileViaApi ( deleFileTestDatasetIds . numericId , testTextFile1Name ) . catch ( ( ) => {
855- throw new Error ( `Tests beforeEach (): Error while uploading file ${ testTextFile1Name } ` )
856+ throw new Error ( `Tests beforeAll (): Error while uploading file ${ testTextFile1Name } ` )
856857 } )
857858
858859 const datasetFiles = await sut . getDatasetFiles (
@@ -861,7 +862,6 @@ describe('FilesRepository', () => {
861862 false ,
862863 FileOrderCriteria . NAME_AZ
863864 )
864-
865865 fileId = datasetFiles . files [ 0 ] . id
866866 } )
867867
@@ -878,13 +878,12 @@ describe('FilesRepository', () => {
878878 await sut . deleteFile ( fileId )
879879
880880 const expectedError = new ReadError ( `[404] File with ID ${ nonExistentFiledId } not found.` )
881-
882881 await expect ( sut . fileHasBeenDeleted ( nonExistentFiledId ) ) . rejects . toThrow ( expectedError )
883882 } )
884883
885884 test ( 'should return True when the dataset is published and the file has not been deleted' , async ( ) => {
886885 await uploadFileViaApi ( deleFileTestDatasetIds . numericId , testTextFile1Name ) . catch ( ( ) => {
887- throw new Error ( `Tests beforeEach(): Error while uploading file ${ testTextFile1Name } ` )
886+ throw new Error ( `Error while uploading file ${ testTextFile1Name } ` )
888887 } )
889888
890889 await publishDatasetViaApi ( deleFileTestDatasetIds . numericId ) . catch ( ( ) => {
@@ -898,16 +897,15 @@ describe('FilesRepository', () => {
898897 false ,
899898 FileOrderCriteria . NAME_AZ
900899 )
901-
902900 fileId = datasetFiles . files [ 0 ] . id
903901
904- const hasBeenDeleted = await sut . fileHasBeenDeleted ( fileId )
905- expect ( hasBeenDeleted ) . toBe ( false )
902+ const notDeleted = await sut . fileHasBeenDeleted ( fileId )
903+ expect ( notDeleted ) . toBe ( false )
906904
907905 await sut . deleteFile ( fileId )
908906
909- const actual = await sut . fileHasBeenDeleted ( fileId )
910- expect ( actual ) . toBe ( true )
907+ const hasBeenDeleted = await sut . fileHasBeenDeleted ( fileId )
908+ expect ( hasBeenDeleted ) . toBe ( true )
911909 } )
912910
913911 test ( 'should return error when file does not exist' , async ( ) => {
0 commit comments