Compare commits
No commits in common. "af562b7b1014e683b407e36507bb8519da77a188" and "1e05ef6abf63e70a061df19c6f3463b29a8d0ee4" have entirely different histories.
af562b7b10
...
1e05ef6abf
@ -1,28 +1,27 @@
|
|||||||
import { describe, it, expect } from "vitest";
|
import { describe, it, expect } from "vitest";
|
||||||
import { searchAndResizeImage } from "../../src/api/image-request"
|
import { searchAndResizeImage } from "../../src/api/image-request"
|
||||||
|
|
||||||
// Ces tests sont commentés pour ne pas provoquer de requêtes à répétitions qui résulteraient en un blocage de google.
|
// Ces tests sont commentés pour ne pas provoquer de requêtes à répétitions qui résulteraient en un blocage de google
|
||||||
//Décommentez les test^s pour les éxecuter
|
|
||||||
|
|
||||||
describe("Image request API", () => {
|
//describe("Image request API", () => {
|
||||||
it();
|
|
||||||
|
|
||||||
//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 () => {
|
// it("return a string", async () => {
|
||||||
// let query = 'cat';
|
// let query = 'cat';
|
||||||
// let imageUrl = await searchAndResizeImage(query);
|
// let imageUrl = await searchAndResizeImage(query);
|
||||||
// expect(imageUrl).toMatch(/^https?:\/\/.*\.(?:png|jpg|jpeg|gif|webp)$/i);
|
// let isString = typeof imageUrl == 'string'
|
||||||
//});
|
// expect(isString).toBe(true);
|
||||||
|
// });
|
||||||
|
|
||||||
//it("returns an empty string when no image is found", async () => {
|
// it("returns a valid image URL when results are found", async () => {
|
||||||
// const query = '[][][][][][][][][][][][][][]'; //cette requête ne renvoie aucune image
|
// let query = 'cat';
|
||||||
// const imageUrl = await searchAndResizeImage(query);
|
// let imageUrl = await searchAndResizeImage(query);
|
||||||
// expect(imageUrl).toEqual('');
|
// 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('');
|
||||||
|
// });
|
||||||
|
//});
|
||||||
|
Loading…
Reference in New Issue
Block a user