|
1 | 1 | import server from '../server'; |
2 | 2 | import supertest from 'supertest'; |
3 | 3 | import resizeImage from '../utilize/sharp'; |
4 | | -import { cache } from 'sharp'; |
5 | | - |
| 4 | +import { getImageMetaData } from '../utilize/sharp'; |
6 | 5 |
|
7 | 6 | const response = supertest ( server ) ; |
8 | 7 |
|
@@ -80,18 +79,22 @@ describe('these tests are focused at the validate middleware a failure tests at |
80 | 79 | }); |
81 | 80 |
|
82 | 81 | describe('these tests are focused at the utilize/sharp file ', () => { |
83 | | - const testImageNameFailer = 'fjod' ; |
84 | | - const testImageNamePass = 'fjord.jpg' ; |
| 82 | + const testImageNameFailure = 'fjod' ; |
85 | 83 | const testImageWidth = 1500 ; |
86 | 84 | const testImageHeight = 1500 ; |
87 | | - it ('1.1 The resizeImage function, not.toThrow ',async ()=>{ |
88 | | - expect( async () => { |
89 | | - await resizeImage (testImageNamePass , testImageWidth , testImageHeight ); |
90 | | - }).not.toThrow(); |
| 85 | + it ('1.1 The resizeImage function,Wrong image name .toBeRejected ',async ()=>{ |
| 86 | + |
| 87 | + await expectAsync( resizeImage (testImageNameFailure , testImageWidth , testImageHeight ) ).toBeRejected(); |
| 88 | + |
| 89 | + }); |
| 90 | + it ('1.2 The getImageMetaData function,Wrong image name .toBeRejected ',async ()=>{ |
| 91 | + |
| 92 | + await expectAsync( getImageMetaData ( testImageNameFailure ) ).toBeRejected(); |
| 93 | + |
91 | 94 | }); |
92 | 95 | }); |
93 | 96 |
|
94 | | -describe('these tests are focused at the createImage middleware at /api/image?' , ()=>{ |
| 97 | +describe('these tests are focused at the createImage middleware at the middleware/api.image.Middleware/createImage.ts ' , ()=>{ |
95 | 98 |
|
96 | 99 | const queriesSchema = { |
97 | 100 | AllCorrect : '?name=encenadaport&width=407&height=365', |
|
0 commit comments