npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

manon-ci-cd-ynov

v1.0.4

Published

📩 Jest-tests

Readme

📩 Jest-tests

Une application React complĂšte avec validation de formulaire, tests unitaires (jest), tests d’intĂ©gration (React Testing Library), tests E2E (Cypress), couverture de code et pipeline CI fonctionnelle.

📌 Description du projet

Jest-tests est une application React avec :

✔ Un formulaire d’inscription ✔ Validation avancĂ©e (Ăąge, email, postCode, identitĂ©, town) ✔ Tests unitaires pour la logique mĂ©tier ✔ Tests d’intĂ©gration pour les interactions React ✔ Tests E2E avec Cypress ✔ Couverture maximale du code ✔ Pipeline de CI avec Codecov

đŸ§± DĂ©marrage rapide

1ïžâƒŁ Clone le dĂ©pĂŽt

git clone https://github.com/myvco/Jest-tests.git cd Jest-tests

2ïžâƒŁ Installer les dĂ©pendances

npm install

3ïžâƒŁ Lancer l’application en mode dĂ©veloppement

npm run dev

4ïžâƒŁ Ouvrir le navigateur 👉 http://localhost:5173

⚙ Scripts disponibles đŸ§Ș Tests Script Description npm run test Lance les tests unitaires avec couvertures npm run coverage GĂ©nĂšre un rapport coverage HTML npm run cypress:run ExĂ©cute les tests E2E

Exemple :

đŸ§Ș Tests unitaires (jest)

Les tests unitaires sont situés dans :

📍 tests/

Ils couvrent :

✅ validateAge (ñge, invalid date, unrealistic, future, <18) ✅ validatePostCode ✅ validateIdentity (types, XSS, invalid chars) ✅ validateEmail ✅ validateTown

Vitest génÚre un rapport de couverture en :

📍 coverage/

🎭 Mocks expliquĂ©s

Pour isoler les tests, certains modules sont mockés :

createUser → contrĂŽlĂ© dans chaque test

getUsers → valeur par dĂ©faut vide

Dans chaque test, on peut surcharger :

getUsers.mockResolvedValue([{ email: "[email protected]" }]);

Cela simule un scĂ©nario d’erreur (email already exists).

🌐 Tests E2E (Cypress)

đŸ”č Cypress teste l’application complĂšte dans le navigateur rĂ©el.

Exemple scénario :

✔ Home page ✔ Navigation vers Form ✔ Submit valide ✔ Validation error backend simuler via cy.intercept()

Exemple d’interception pour forcer erreur backend cy.intercept("POST", "https://jsonplaceholder.typicode.com/users", { statusCode: 400, body: { message: "Email already exists" } }).as("createUserError");

cy.get('button[type="submit"]').click(); cy.wait("@createUserError"); cy.contains(/email already exists/i).should("be.visible");

đŸ€– Pipeline CI (GitHub Actions + Codecov) 📌 Objectif

✔ ExĂ©cuter les tests unitaires ✔ GĂ©nĂ©rer la couverture ✔ Publier le rapport sur Codecov

Exemple de workflow : .github/workflows/ci.yml name: CI

on: [push, pull_request]

jobs: test: runs-on: ubuntu-latest

steps:
  - uses: actions/checkout@v3
  - uses: actions/setup-node@v3
    with:
      node-version: "18"
  - run: npm install
  - run: npm test -- --coverage
  - run: npm run coverage
  - name: Upload coverage to Codecov
    uses: codecov/codecov-action@v3
    with:
      files: ./coverage/lcov.info
      fail_ci_if_error: true

🚀 À chaque push/PR, Codecov affiche le coverage à jour.

📊 Couverture de code

Vitest génÚre :

✔ text summary ✔ HTML report (coverage/index.html) ✔ LCOV (coverage/lcov.info)

Codecov utilise lcov pour afficher :

📉 Coverage global 📉 Coverage par fichier 📉 Branch coverage

💡 Assurez-vous que vitest.config.js inclut les bons patterns :

coverage: { provider: 'v8', reporter: ['text', 'html', 'lcov'], include: [ 'src/utils//*.js', 'src/component//*.jsx' ], exclude: [ 'src/main.jsx', 'src/App.jsx' ] }

🔗 Package NPM : https://www.npmjs.com/package/manon-ci-cd-ynov