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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@constl/utils-tests

v2.0.7

Published

<p align="center"> <a href="https://docu.réseau-constellation.ca" title="Constellation"> <img src="https://docu.xn--rseau-constellation-bzb.ca/logo.svg" alt="Logo Constellation" width="244" /> </a> </p> <h1 align="center">Utils-tests Constellation

Readme

tests couverture

Installation

$ pnpm add --save-dev @constl/utils-tests

Cette librairie fournie des fonctions utilitaires pour tester Constellation et les autres librairies basées sur celle-ci.

Utilisation

Constellation

Création d'instances éphémères Constellation pour les tests.

import { créerConstellation } from "@constl/ipa";
import { créerConstellationsTest } from "@constl/utils-tests"

const { constls, fermer } = créerConstellationsTest({
  n: 2,
  créerConstellation
});

// Ici les Constellations sont déjà connectées l'une à l'autre.

const idBd = await constls[0].bds.créerBd({ licence: "ODbl-1_0" });
await constls[1].bds.suivreNoms({ idBd });

// Fermera les Constellations et effacera toutes leurs données du système
await fermer();

Orbite et Hélia

Création d'instances éphémères d'OrbitDB et de Hélia pour les tests.

Pour Hélia:

import { créerHéliasTest } from "@constl/utils-tests"

const { hélias, fermer } = créerHéliasTest({
  n: 2,
});

await fermer();

Pour OrbitDB:

import { créerOrbitesTest } from "@constl/utils-tests"

const { orbites, fermer } = créerOrbitesTest({
  n: 2,
});


// Ici les instances d'OrbitDB sont déjà connectées l'une à l'autre.

const bd = await orbites[0].open("données tests", { type: "keyvalue" });
await bd.set("a", 1)

const bdSurLAutreOrbite = await orbites[1].open(bd.address);
await bd.get("a") // => 1

await fermer()  // Effacera toutes les données

Compilation

Plusieurs fonctions utilitaires de compilation sont incluses.

import { obtConfigEsbuild, générerConfigÆgir } from "@constl/utils-tests"

// Génère une configuration esbuild pour compiler Constellation sur navigateur
const config = await obtConfigEsbuild();


// Génère une configuration à mettre dans `.aegir.js` pour tester des projets avec Ægir (https://github.com/ipfs/aegir). Gère automatiquement la création d'un relai si nécessaire pour vos tests.
const configÆgir = await générerConfigÆgir();

Relai

Lance un relai local qui permet de connecter des instances de Constellation dans les tests sur navigateur.

// Dans un fichier qui sera exécuté dans un processus séparé des tests (p. ex., `.aegir.js`, voir https://github.com/ipfs/aegir);
import { lancerRelai } from "@constl/utils-tests"

await lancerRelai();

Dossiers

Fonction utilitaire pour créer des dossiers temporaires pour les tests.

import { dossierTempo } from "@constl/utils-tests"

const { dossier, effacer } = await dossierTempo();

// `dossier` existe

effacer();
// Le dossier n'existe plus

Attente

Fonctions utilitaires pour attendre des résultats.

import { attendreFichierExiste, attendreFichierModifié } from "@constl/utils-tests"

await attendreFichierExiste({ fichier: "./un/fichier.txt" });
// Maintenant le fichier existe

await attendreFichierModifié({ fichier: "./un/fichier.txt" });
// Le fichier a été modifié depuis l'appel à `attendreFichierModifié`

// Attendra que la condition retourne `true`
await que(()=>true)