innovation-lab-examples test.instructions.md

Testing instructions for canister functions using Jest, a JavaScript and TypeScript testing framework.

In plain words
What is it for?
Use them when writing or reviewing canister tests, including setup, execution, assertions, descriptive test names, type checking, and running the test suite.
Why use it?
They encourage tests to cover both successful and failing cases and provide checks for TypeScript errors and passing tests.

Instructions file for GitHub Copilot

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 instructions/fetchai/innovation-lab-examples/test
Clone the repo
git clone --depth 1 https://github.com/fetchai/innovation-lab-examples

Made for: GitHub Copilot.

Per session 226 This file is loaded in full into every session.
When invoked 226 The same file — it is already loaded in full.
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.00226 $0.00226
Opus 5 $0.00113 $0.00113
Sonnet 5 $0.00045 $0.00045
Haiku 4.5 $0.00023 $0.00023

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

Security

Grade A, and why

innovation-lab-examples test.instructions.md 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 2d 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.

web3/internet-computer/.github/instructions/test.instructions.md · 48 lines

What it actually says

Writing Tests for Canister Functions

When writing tests for canister functions:

  • Use Jest for canister testing
  • Include setup, execution, and assertion phases in each test
  • Test both happy path and error cases
  • Use descriptive test names that explain the expected behavior

Example test structure:

it("should [expected consequence]", async () => {
  // Setup
  const testData = "world";

  // Execute
  const response = await fetch(`${origin}/db/update`, {
    method: "POST",
    headers: [["Content-Type", "application/json"]],
    body: JSON.stringify({
      hello: testData,
    }),
  });

  const responseJson = await response.json();

  // Assert
  expect(responseJson).toEqual({ hello: "world" });
});

After writing the tests, check if the file has any errors:

npx tsc -p ic/tsconfig.json

Then check that they are all passing by executing:

npm test
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. 2d ago First seen · 48 lines · 226 tokens per session scan A 76da16a5482e

Subscribe to this mod's changes

innovation-lab-examples test.instructions.md is an instructions file published in the GitHub repository fetchai/innovation-lab-examples (1,148 stars, last pushed 19d ago), licensed MIT. It adds 226 tokens to every session, about $0.0011 per session on Opus 5. 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-30.