testing

testing is a cursor rule for Cursor from inventwo/ioBroker.autodarts. It costs 0 tokens per session (407 once invoked), scanned A, original, MIT.

A testing setup for ioBroker adapters, using the @iobroker/testing package for integration tests and Mocha for unit tests.

In plain words
What is it for?
Run unit tests, validate package and admin files, or test an adapter starting and reading states through a local development server.
Why use it?
It keeps unit tests, package checks, and local integration tests consistent, so changes can be checked with known commands.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/inventwo/iobroker.autodarts/testing
Clone the repo
git clone --depth 1 https://github.com/inventwo/ioBroker.autodarts

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testing

README.md
[![agentmods](https://agentmods.dev/badge/rules/inventwo/iobroker.autodarts/testing.svg)](https://agentmods.dev/rules/inventwo/iobroker.autodarts/testing)
Your own site
<a href="https://agentmods.dev/rules/inventwo/iobroker.autodarts/testing"><img src="https://agentmods.dev/badge/rules/inventwo/iobroker.autodarts/testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 407 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00407
Opus 5 $0.00000 $0.00204
Sonnet 5 $0.00000 $0.00081
Haiku 4.5 $0.00000 $0.00041

Measured 3d ago against content hash 158ae8e06db2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/testing.mdc · 56 lines

What it actually says

Testing

Use only @iobroker/testing for integration tests — https://github.com/ioBroker/testing

Unit tests use Mocha (not Jest).

Scripts

  • npm run test — unit (test:js) + package validation (CI default)
  • npm run test:js — Mocha unit tests (*.test.js, test/**)
  • npm run test:package — validates package.json, io-package.json, admin JSON
  • npm run test:integration — integration tests via dev-server (local only)

Integration test pattern

const path = require("node:path");
const { tests } = require("@iobroker/testing");

tests.integration(path.join(__dirname, ".."), {
  defineAdditionalTests({ suite }) {
    suite("Test adapter with specific configuration", (getHarness) => {
      let harness;
      before(() => { harness = getHarness(); });

      it("should configure and start adapter", function () {
        return new Promise(async (resolve, reject) => {
          // configure via harness.objects.setObject()
          // start via harness.startAdapterAndWait()
          // verify via harness.states.getState() / getStateIDs()
        });
      }).timeout(40000);
    });
  }
});

Rules

  • Configure via harness.objects.setObject() before start
  • Start via harness.startAdapterAndWait()
  • Verify via harness.states.getState() / getStateIDs()
  • Plan sufficient timeouts for async operations
  • Mock external APIs in unit tests; never bypass the harness
  • Never test Board Manager URLs directly in integration tests

CI order

Lint first (check-and-lint), then adapter-tests — adapter tests do not run if lint fails.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 56 lines · 0 tokens per session scan A 158ae8e06db2

Subscribe to this mod's changes

testing is a cursor rule published in the GitHub repository inventwo/ioBroker.autodarts (4 stars, last pushed 6d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 407 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.