diff --git a/filter.test.js b/filter.test.js
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e37a5b14d6956e941ac87427f4ce33bc3711ed06 100644
--- a/filter.test.js
+++ b/filter.test.js
@@ -0,0 +1,32 @@
+const { filterByWeight, filterByHeight } = require('./script.js')
+
+test('filtre les pokémons dont le poids est supérieur à 3kg', () => {
+    const pokemons = [
+        { name: 'Bulbasaur', weight: 6.9, height: 0.7 },
+        { name: 'ivysaur', weight: 13, height: 1 },
+        { name: 'venusaur', weight: 100, height: 2 },
+        { name: 'Charmander', weight: 2, height: 0.6 },
+    ];
+
+    const result = filterByWeight(pokemons);
+    expect(result).toEqual([
+        { name: 'Bulbasaur', weight: 6.9, height: 0.7 },
+        { name: 'ivysaur', weight: 13, height: 1 },
+        { name: 'venusaur', weight: 100, height: 2 },
+    ]);
+});
+
+test('filtre les pokémons dont la taille est inférieure à 1m', () => {
+    const pokemons = [
+        { name: 'Bulbasaur', weight: 6.9, height: 0.7 },
+        { name: 'ivysaur', weight: 13, height: 1 },
+        { name: 'venusaur', weight: 100, height: 2 },
+        { name: 'Charmander', weight: 2, height: 0.6 },
+    ];
+
+    const result = filterByHeight(pokemons);
+    expect(result).toEqual([
+        { name: 'Bulbasaur', weight: 6.9, height: 0.7 },
+        { name: 'Charmander', weight: 2, height: 0.6 },
+    ]);
+});
\ No newline at end of file
diff --git a/gui.js b/gui.js
new file mode 100644
index 0000000000000000000000000000000000000000..1a39b27954e282f78e751acf62626b4423615cfc
--- /dev/null
+++ b/gui.js
@@ -0,0 +1,58 @@
+
+function fetchPokemonList(callback, limit = 20) {
+    const baseApiUrl = "https://pokeapi.co/api/v2/pokemon";
+    const url = baseApiUrl + "?limit=" + limit;
+    const request = async () => {
+        const response = await fetch(url);
+        const json = await response.json();
+        let promisesArray = json["results"].map(result => {
+            return fetch(result.url).then(response => response.json());
+        });
+        return Promise.all(promisesArray);
+    };
+    request().then((data) => {
+        let pokemons = [];
+        for (let i = 0; i < data.length; ++i) {
+            pokemons.push({
+                "name": data[i].name,
+                "weight": data[i].weight / 10, // Convert to kg
+                "height": data[i].height / 10  // Convert to m
+            });
+        }
+        callback(pokemons);
+    });
+}
+
+
+function displayPokemons(list) {
+    const container = document.getElementById("pokemon-list");
+    container.innerHTML = "";
+    list.forEach(pokemon => {
+        const div = document.createElement("li");
+        div.textContent = `${pokemon.name} - ${pokemon.weight}kg - ${pokemon.height}m`;
+        container.appendChild(div);
+    });
+}
+
+
+fetchPokemonList((pokemons) => {
+    displayPokemons(pokemons);
+});
+
+function filterByWeight(pokemons) {
+    return pokemons.filter(pokemon => pokemon.weight > 3);
+}
+
+function filterByHeight(pokemons) {
+    return pokemons.filter(pokemon => pokemon.height < 1);
+}
+
+document.getElementById("all").addEventListener("click", () => fetchPokemonList(displayPokemons));
+
+document.getElementById("weight").addEventListener("click", () => fetchPokemonList((pokemons) => {
+    displayPokemons(filterByWeight(pokemons));
+}));
+
+document.getElementById("height").addEventListener("click", () => fetchPokemonList((pokemons) => {
+    displayPokemons(filterByHeight(pokemons));
+}));
diff --git a/index.html b/index.html
index 8b7a0f42487e023dee5c0f02009e294dff56e702..220ac359cffcb8facc682b346011662d5387fea2 100644
--- a/index.html
+++ b/index.html
@@ -12,6 +12,6 @@
     <button id="weight">+ de 3kg</button>
     <button id="height">- de 1m</button>
     <ul id="pokemon-list"></ul>
-    <script src="script.js"></script>
+    <script src="gui.js"></script>
 </body>
 </html>
\ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..90021b61ab0f98d7b5559a9919ee7a7e4b6c2b9a
--- /dev/null
+++ b/package.json
@@ -0,0 +1,12 @@
+{
+  "devDependencies": {
+    "jest": "^29.7.0"
+  },
+  "scripts": {
+    "test": "jest"
+  }
+}
+
+
+
+
diff --git a/pokemonprovider.js b/pokemonprovider.js
new file mode 100644
index 0000000000000000000000000000000000000000..32eeb7a36c70d85b2e34515656f38fc265e9ca51
--- /dev/null
+++ b/pokemonprovider.js
@@ -0,0 +1,38 @@
+function fetchPokemonList(callback, limit = 20) {
+    const baseApiUrl = "https://pokeapi.co/api/v2/pokemon";
+    const url = baseApiUrl + "?limit=" + limit;
+    const request = async () => {
+        const response = await fetch(url);
+        const json = await response.json();
+        let promisesArray = json["results"].map(result => {
+            return fetch(result.url).then(response => response.json());
+        });
+        return Promise.all(promisesArray);
+    };
+    request().then((data) => {
+        let pokemons = [];
+        for (let i = 0; i < data.length; ++i) {
+            pokemons.push({
+                "name": data[i].name,
+                "weight": data[i].weight / 10, // Convert to kg
+                "height": data[i].height / 10  // Convert to m
+            });
+        }
+        callback(pokemons);
+    });
+}
+
+
+function displayPokemons(list) {
+    const container = document.getElementById("pokemon-list");
+    container.innerHTML = "";
+    list.forEach(pokemon => {
+        const div = document.createElement("li");
+        div.textContent = `${pokemon.name} - ${pokemon.weight}kg - ${pokemon.height}m`;
+        container.appendChild(div);
+    });
+}
+
+
+exports.fetchPokemonList = fetchPokemonList;
+exports.displayPokemons = displayPokemons;
diff --git a/script.js b/script.js
index fb924b9a9e75dddeebe5ac7e0075972e68d03daf..1d4cffd7b430b53bea8dc8128f29b24bed1657c1 100644
--- a/script.js
+++ b/script.js
@@ -1,64 +1,13 @@
-// Récupérer les Pokémon via l'API
-function fetchPokemonList(callback, limit = 20) {
-    const baseApiUrl = "https://pokeapi.co/api/v2/pokemon";
-    const url = baseApiUrl + "?limit=" + limit;
-    const request = async () => {
-        const response = await fetch(url);
-        const json = await response.json();
-        let promisesArray = json["results"].map(result => {
-            return fetch(result.url).then(response => response.json());
-        });
-        return Promise.all(promisesArray);
-    };
-    request().then((data) => {
-        let pokemons = [];
-        for (let i = 0; i < data.length; ++i) {
-            pokemons.push({
-                "name": data[i].name,
-                "weight": data[i].weight / 10, // Convert to kg
-                "height": data[i].height / 10  // Convert to m
-            });
-        }
-        callback(pokemons);
-    });
-}
-
-function displayPokemons(list) {
-    const container = document.getElementById("pokemon-list");
-    container.innerHTML = "";
-    list.forEach(pokemon => {
-        const div = document.createElement("li");
-        div.textContent = `${pokemon.name} - ${pokemon.weight}kg - ${pokemon.height}m`;
-        container.appendChild(div);
-    });
-}
 
-fetchPokemonList((pokemons) => {
-    displayPokemons(pokemons);
-});
+// Fonctions de filtrage
 
-//Fonctions de filtrage
 function filterByWeight(pokemons) {
     return pokemons.filter(pokemon => pokemon.weight > 3);
 }
+
 function filterByHeight(pokemons) {
     return pokemons.filter(pokemon => pokemon.height < 1);
 }
 
-// Filtrage
-document.getElementById("all").addEventListener("click", () => fetchPokemonList((pokemons) => {
-    displayPokemons(pokemons);
-}));
-
-document.getElementById("weight").addEventListener("click", () => {
-    fetchPokemonList((pokemons) => {
-        displayPokemons(filterByWeight(pokemons));}
-    );
-});
-
-document.getElementById("height").addEventListener("click", () => {
-    fetchPokemonList((pokemons) => {
-        displayPokemons(filterByHeight(pokemons));
-    });
-});
-
+exports.filterByWeight = filterByWeight;
+exports.filterByHeight = filterByHeight;
\ No newline at end of file