commented a tests file for security reasons. Updated README
This commit is contained in:
parent
3f0db3f976
commit
aa448921ac
13
README.md
13
README.md
@ -1,6 +1,17 @@
|
||||
|
||||
# Projet BUT 3
|
||||
|
||||
made by :
|
||||
Simon CATANESE
|
||||
Julien CHARBONNEL
|
||||
Victor DESCAMPS
|
||||
|
||||
## Tests warning :
|
||||
|
||||
the tests sheet 'api/image-request.test.jsx' was commented out to avoid over-sending requests to the google API during development. Remember to uncomment the file if you want to run all the tests once, but remember to recomment the file if you want to run a series of tests.
|
||||
An over-sending of requests could get us blocked for the day by google.
|
||||
|
||||
|
||||
## Run Locally
|
||||
|
||||
Clone the project
|
||||
@ -30,3 +41,5 @@ Start the front-end
|
||||
## API Reference
|
||||
|
||||
API Documentation : [Postman]([Postman documentation url])
|
||||
|
||||
|
||||
|
@ -1,25 +1,27 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { searchAndResizeImage } from "../../src/api/image-request"
|
||||
|
||||
describe("Image request API", () => {
|
||||
// Ces tests sont commentés pour ne pas provoquer de requêtes à répétitions qui résulteraient en un blocage de google
|
||||
|
||||
//describe("Image request API", () => {
|
||||
|
||||
|
||||
it("return a string", async () => {
|
||||
let query = 'cat';
|
||||
let imageUrl = await searchAndResizeImage(query);
|
||||
let isString = typeof imageUrl == 'string'
|
||||
expect(isString).toBe(true);
|
||||
});
|
||||
// it("return a string", async () => {
|
||||
// let query = 'cat';
|
||||
// let imageUrl = await searchAndResizeImage(query);
|
||||
// let isString = typeof imageUrl == 'string'
|
||||
// expect(isString).toBe(true);
|
||||
// });
|
||||
|
||||
it("returns a valid image URL when results are found", async () => {
|
||||
let query = 'cat';
|
||||
let imageUrl = await searchAndResizeImage(query);
|
||||
expect(imageUrl).toMatch(/^https?:\/\/.*\.(?:png|jpg|jpeg|gif|webp)$/i);
|
||||
});
|
||||
// it("returns a valid image URL when results are found", async () => {
|
||||
// let query = 'cat';
|
||||
// let imageUrl = await searchAndResizeImage(query);
|
||||
// expect(imageUrl).toMatch(/^https?:\/\/.*\.(?:png|jpg|jpeg|gif|webp)$/i);
|
||||
// });
|
||||
|
||||
it("returns an empty string when no image is found", async () => {
|
||||
const query = '[][][][][][][][][][][][][][]'; //cette requête ne renvoie aucune image
|
||||
const imageUrl = await searchAndResizeImage(query);
|
||||
expect(imageUrl).toEqual('');
|
||||
});
|
||||
});
|
||||
// it("returns an empty string when no image is found", async () => {
|
||||
// const query = '[][][][][][][][][][][][][][]'; //cette requête ne renvoie aucune image
|
||||
// const imageUrl = await searchAndResizeImage(query);
|
||||
// expect(imageUrl).toEqual('');
|
||||
// });
|
||||
//});
|
||||
|
Loading…
Reference in New Issue
Block a user