Logo de Hor Backend Testing

Hor Backend Testing

Organisation
openreachtech
hor-backend-testing

Organize and run the backend repository's tests: where a test file goes (tests/__tests__ for tests that do not write to the database, tests/_orders for tests that do), how run order among DB-writing tests is guaranteed, how to run the whole suite or a single test, and the purity rules for tests and their doubles. Use whenever the user asks where to place a test, how to guarantee test order, how to run tests, or how to keep tests pure. Manual E2E verification is out of scope.

Présentation

Éditeuropenreachtech
Dépôthora-skills-ort-renchan
Nom de la compétencehor-backend-testing
Étoiles
32
Forks
0
Fichiers inclus
3
LicenceApache-2.0
Liens
  • Instructions en Markdown

    Un fichier SKILL.md que le modèle charge à la demande : il ne consomme donc des tokens que lorsqu’une demande correspond réellement à la compétence.

  • Compatible avec tous les LLM

    Les compétences IA sont en simple Markdown, et non en code propre à un fournisseur. Elles fonctionnent donc avec GPT, Claude, Gemini, Grok ou un modèle local.

  • 3 fichiers inclus

    Des scripts, des modèles de documents et des références que le modèle peut consulter pendant son travail. Les fichiers sont en lecture seule et ne sont jamais exécutés.

  • Open source

    Publiée par openreachtech sur GitHub. Consultez les sources avant de l’installer.

Installation

Installez la compétence IA Hor Backend Testing dans TypingMind pour l’utiliser avec n’importe quel LLM, ou ajoutez-la à un autre agent capable de lire SKILL.md.

1

Installer dans TypingMind

TypingMind installe une compétence directement depuis son dossier GitHub : l’application lit SKILL.md, regroupe les fichiers de ressources et enregistre le tout localement.

  1. Ouvrez l’application et accédez à Plugins → Compétences.
  2. Choisissez « Installer depuis GitHub ».
  3. Collez l’URL du dossier de la compétence indiquée ci-dessous, puis confirmez.
    https://github.com/openreachtech/hora-skills-ort-renchan/tree/main/kit/skills/hor-backend-testing
  4. Activez la compétence dans chaque discussion où vous souhaitez pouvoir l’utiliser.
Plugins → Compétences → Ajouter → Via URL GitHub, puis collez l’URL du dossier et appuyez sur Continuer.
2

Installer dans un autre agent

Tout agent capable de lire le format Agent Skills peut utiliser cette compétence : copiez le dossier dans le répertoire des compétences de cet agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/openreachtech/hora-skills-ort-renchan.git /tmp/hora-skills-ort-renchan
mkdir -p .claude/skills
cp -r /tmp/hora-skills-ort-renchan/kit/skills/hor-backend-testing .claude/skills/hor-backend-testing
Redémarrez Claude Code après la copie pour que la nouvelle compétence soit prise en compte.

Utilisez cette compétence dans TypingMind

Activez Hor Backend Testing dans n’importe quelle discussion TypingMind et le modèle s’occupe du reste. Le nom et la description de la compétence figurent dans le prompt système. Dès qu’une demande correspond, le modèle charge lui-même l’intégralité des instructions : vous n’avez jamais à l’invoquer manuellement, et elle ne consomme aucun token tant qu’elle n’est pas utilisée.

Le modèle charge automatiquement Hor Backend Testing dès qu’une demande correspond à cette compétence.

Compatible avec tous les modèles IA

Les compétences IA sont de simples instructions Markdown, et non du code propre à un fournisseur. Ainsi, Hor Backend Testing n’est pas lié au modèle pour lequel cette compétence a été conçue. Installez-la une seule fois dans TypingMind et utilisez-la avec GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou un modèle local que vous exécutez vous-même, le tout avec vos propres clés API.

  • Chargée uniquement en cas de besoin

    Le prompt système ne contient que le nom et la description. Les instructions sont récupérées à la première demande correspondante : une compétence inutilisée ne coûte donc rien.

  • Changez de modèle en cours de discussion

    La compétence étant constituée d’instructions et non de code, elle reste fonctionnelle lorsque vous changez de modèle : le nouveau modèle lit le même fichier SKILL.md.

Instructions de la compétence

Voici le contenu de SKILL.md que le modèle charge. Lisez-le avant l’installation : une compétence contient des instructions que votre modèle suivra.

Backend Testing

A skill for implementing tests in a backend repository: where each test file belongs, how DB-writing tests are ordered so they do not corrupt each other, how to run them, and the purity rules that keep a failing test meaningful. It governs test organization and discipline — the writing style of an individual test (describe/test structure, case data, naming) follows the project's own Jest conventions and is out of scope here.

This skill states a general, project-independent rule, not one repo's current tree. The directory names (tests/__tests__, tests/_orders, tests/mocks, tests/tools) are the recommended layout — map them onto your project. Sample code follows the project's lint style (no semicolons, 2-space indent, trailing commas).

Core principle: a test fails only when the code under test is wrong

A test must fail only because the code it exercises is wrong — not because another test ran first, and not because the test itself contains untested logic. Two rules enforce that, and everything below follows from them:

  1. Isolate database state. A test that writes to the DB mutates shared seed data that other tests read, so it is placed apart from tests that don't, and ordered among its peers.
  2. Keep tests pure. A test may only exercise code that is itself already tested — no logic is invented inside a test, and every mock/tool it leans on has its own test cases.

1. Placement & execution order

Split every test by one question: does it write to the database?

LocationContentsOrdering
tests/__tests__/tests that do not write to the DB (pure units, read-only)order-independent — run in any order
tests/_orders/<Category>/tests that do write to the DBorder-guaranteed within a category via a _.test.js barrel
  • Why the split. A DB-writing test changes the shared development / dev-master seed fixtures, so a later test can observe a mutated database. Read-only tests can't interfere, so they need no ordering; DB-writing tests must be ordered.
  • The order barrel. Each category folder holds _.test.js that imports its test files in the order they must run — that import order is the execution order within the category.
  • Cross-category order is NOT guaranteed. _orders fixes order within a category only. If two categories can interfere, isolate them into separate CI jobs — add/update a .github/workflows/*.yml per category so each runs against its own fresh database.
  • Verification against real middleware belongs in neither location. Exercising the product against a real broker, search cluster and change-data-capture pipeline needs those services brought up in Docker and is done by hand, outside tests/ entirely — see the E2E environment convention. No such file is added here, and npm run test stays runnable with nothing but Node installed.

Details, the barrel example, and the per-category workflow snippet are in placement-and-ordering.md.

2. Running tests

  • Whole suite: npm run test — rebuilds the DB (teardown → migrate → seed) and runs everything on SQLite (the local default). Authoritative, slowest.
  • A single test (fast, no rebuild): iterate by invoking Jest directly against one file — NODE_OPTIONS="--experimental-vm-modules" NODE_ENV=development npx jest <path> (add --runInBand for DB-writing/order-sensitive tests). It runs against the DB as it currently is, so prepare the DB once and reset it piecemeal (migrations-only / one-seeder-set) instead of a full rebuild.
  • Live (real-dialect) run: running against the database the project's specification names (MariaDB, MySQL or PostgreSQL) instead of SQLite requires that database running locally, selected with NODE_ENV=live. Test against the one the specification names, never another database of the same family. How that database is stood up is not part of this convention.
  • Parallelism × per-worker heap must fit in real memory. Jest runs one worker per core by default, and --max-old-space-size is not a reservation — it is how far the GC may be deferred, so a value the machine cannot actually give lets every worker grow until it crashes the machine (one worker alone can do it). Derive the cap from a measured peak, check that workers × cap fits in the memory actually free, and re-check as the project grows: per-worker usage rises with every model and seeder added, so a pair that fit at the start can later crash the machine.

The exact commands, the suite runner's steps, the fast single-test loop with the piecemeal DB reset, and how to size the worker/heap budget are in running-tests.md.

3. Test purity & test doubles

  • No new logic in a test. Never define a function or class inside a test to compute an expected value or stand in for production behavior — an untested helper can be wrong, making the test lie. Assert against literal expectations.
  • Everything a test uses must already be tested. Every function, class, mock, and tool the test leans on has its own test cases.
  • Doubles live under tests/, and are themselves tested. Mocks go in tests/mocks/, shared test tools/factories in tests/tools/, and each mock class has its own test file. Prefer explicit fakes (obviously-fake names/values).

The rule with good/avoid examples, and the mocks/tools layout, are in purity-and-mocks.md.

Finishing checklist

  • The test is in tests/__tests__/ if it does no DB write, or tests/_orders/<Category>/ if it does (§1).
  • A DB-writing test is imported (in the right position) by its category's _.test.js barrel.
  • If the new test's category can interfere with another, a per-category CI workflow isolates them.
  • The test defines no new logic; every function/class/mock it uses is already tested (§3).
  • Any new mock/tool lives under tests/mocks/ or tests/tools/ and has its own test file.
  • Verified with a single-test run (§2).

Detail files

  • placement-and-ordering.md — __tests__ vs _orders, why DB-writing tests need ordering, the _.test.js order barrel, cross-category isolation via per-category CI workflows (§1)
  • running-tests.md — the whole-suite runner and what it does, running a single test with the dev/master seed sets, resetting the database piecemeal, sizing the parallelism × heap budget against real memory, and what a live (real-dialect) run requires (§2)
  • purity-and-mocks.md — no-new-logic and only-tested-code rules with good/avoid examples, and the tests/mocks / tests/tools layout where doubles are themselves tested (§3)

Fichiers inclus

Le modèle lit ces fichiers à la demande lorsque la compétence est chargée. Ils sont accessibles en lecture et ne sont jamais exécutés.

Foire aux questions

À quoi sert la compétence IA Hor Backend Testing ?

Organize and run the backend repository's tests: where a test file goes (tests/__tests__ for tests that do not write to the database, tests/_orders for tests that do), how run order among DB-writing tests is guaranteed, how to run the whole suite or a single test, and the purity rules for tests and their doubles. Use whenever the user asks where to place a test, how to guarantee test order, how to run tests, or how to keep tests pure. Manual E2E verification is out of scope.

Pourquoi utiliser Hor Backend Testing sur TypingMind ?

Parce que vous l’installez une seule fois pour l’utiliser avec n’importe quel modèle. Hor Backend Testing se compose de simples instructions en Markdown plutôt que de code propre à un fournisseur. La même compétence fonctionne donc avec GPT-5, Claude, Gemini, Grok ou un modèle local, et vous pouvez changer de modèle en cours de discussion sans perturber son fonctionnement. TypingMind utilise vos propres clés API : vous payez donc directement les fournisseurs plutôt qu’un abonnement par siège, et vos compétences et discussions restent dans votre propre espace de stockage.

Comment installer Hor Backend Testing dans TypingMind ?

Dans TypingMind, ouvrez Plugins → Compétences → Installer depuis GitHub et collez https://github.com/openreachtech/hora-skills-ort-renchan/tree/main/kit/skills/hor-backend-testing. TypingMind lit le fichier SKILL.md, regroupe les fichiers associés et installe le tout sous forme de compétence que vous pouvez activer pour chaque discussion.

Quels modèles d’IA peuvent utiliser Hor Backend Testing ?

N’importe quel modèle que vous connectez dans TypingMind. Les compétences IA sont de simples instructions en Markdown, et non du code propre à un fournisseur. GPT, Claude, Gemini, Grok et les modèles locaux peuvent donc tous charger cette compétence lorsqu’une demande lui correspond.

Combien de modèles d’IA puis-je utiliser avec Hor Backend Testing ?

Autant que vous le souhaitez. Tant qu’un modèle prend en charge les compétences, vous pouvez utiliser Hor Backend Testing avec lui : GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama et bien d’autres, le tout dans TypingMind avec vos propres clés API.

La compétence IA Hor Backend Testing est-elle gratuite ?

Oui. Cette compétence est publiée sur GitHub par openreachtech sous licence Apache-2.0. Vous ne payez que votre propre fournisseur d’IA pour les tokens utilisés.

Que sont les compétences IA ?

Une compétence IA est un ensemble d’instructions réutilisables qui apprend à un modèle d’IA à accomplir une tâche précise. Elle suit le format ouvert Agent Skills : un fichier SKILL.md contenant un nom et une description, ainsi que les éventuels scripts, modèles de documents ou fichiers de référence dont le modèle peut avoir besoin. Le modèle ne lit les instructions que lorsque votre demande correspond à la compétence. Une compétence installée ne coûte donc rien tant qu’elle n’est pas utilisée.

En quoi les compétences IA diffèrent-elles des plugins ou des serveurs MCP ?

Un plugin ou un serveur MCP fournit au modèle de nouveaux outils à appeler : du code qui s’exécute quelque part et renvoie un résultat. Une compétence IA lui apporte plutôt des connaissances et une méthode : comment aborder une tâche, quelles étapes suivre et à quoi ressemble un bon résultat. Les compétences sont de simples instructions en Markdown. Elles ne nécessitent donc ni serveur, ni clé API, ni environnement d’exécution, et fonctionnent avec n’importe quel modèle.

Tout voir

Créez votre propre espace IA dès maintenant

Abonnez-vous à notre newsletter pour être informé des nouvelles fonctionnalités et des prochains cadeaux à gagner 👇