
fusion-framework-testing
Guides writing and running Vitest tests for Fusion Framework React apps with @equinor/fusion-framework-vitest-plugin-react-app — choosing a testing layer, configuring vitest.config.ts and Browser Mode, rendering with test/render/renderAppHook/renderAppComponent/testApp fixtures, and troubleshooting or migrating a suite. USE FOR: writing a new app/component/hook test, setting up vitest.config.ts for a Fusion app, choosing between app/framework/module/HTTP test layers, composing or overriding test fixtures, diagnosing a failing Fusion app test. DO NOT USE FOR: seeding module-specific mock state (auth, context, bookmarks, feature flags, HTTP) — use fusion-framework-mocking; dev-server-time API mocking/proxying (use fusion-developer-app); non-Fusion test suites; backend/service-repo tests.
- Installs
- 118
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/equinor/fusion-skills --skill fusion-framework-testing- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads fusion-framework-testing automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Fusion Framework Testing
When to use
Use when writing or running a Vitest test for a Fusion Framework React app — a hook, component, route, or complete app — or when setting up/troubleshooting the test project itself.
Typical triggers:
- "Write a test for this component / hook / route"
- "Set up
vitest.config.tsfor this app" - "Why does this test hang / hit the network / fail to resolve the app?"
- "Should this be a hook test or a component test?"
- "Share seeded fixtures across a test file"
- "Migrate this suite off Testing Library / jsdom"
Implicit triggers:
- A test file imports
@equinor/fusion-framework-vitest-plugin-react-app(or its/test,/configsub-paths) vitest.config.tsneeds Browser Mode, Playwright, or app-file resolution configured- A test renders a component/hook that reads
useAppModule,useFramework, or similar
When not to use
- Seeding module-specific state (a signed-in user, current context, feature flags, HTTP
responses) — use
fusion-framework-mocking; this skill only covers rendering/running the test dev-server.config.tsAPI mocking/proxying for localffc app dev— dev-time only, seefusion-developer-app- Non-Fusion test suites, or backend/service-repo tests
Required inputs
Mandatory
- What is under test: pure function, hook, component, route, or complete app
- Whether the project already has
vitest.config.tsconfigured for this package
Conditional
- Whether the test needs a specific signed-in user, seeded context, or faked HTTP response (then
hand off to
fusion-framework-mockingfor the seeding details) - Whether several test files need the same fixture defaults
Instructions
Step 1 — Choose the smallest layer for the behavior under test
Fusion test utilities substitute external boundaries only; Vitest still owns the runner, assertions, lifecycle hooks, spies, timers, and coverage.
| Testing intent | Start with | Import |
|---|---|---|
| Pure function or framework-independent hook | Standard Vitest | vitest |
| React hook that consumes app modules | renderAppHook | @equinor/fusion-framework-vitest-plugin-react-app |
| React component, route, or complete app | test/render fixture | @equinor/fusion-framework-vitest-plugin-react-app/test |
| Reusable app fixture without automatic app-file resolution | testApp | @equinor/fusion-framework-vitest-plugin-react-app |
| App module configuration without React | mockAppModules | see fusion-framework-mocking |
| Parent framework or portal-level modules | mockFramework | see fusion-framework-mocking |
| One method call, timer, global, or JS module | Vitest's vi APIs | vitest |
A component test should not recreate a portal; an app-lifecycle test should not replace every
Fusion hook with a JavaScript module mock. See references/getting-started-and-configuration.md
for the full layer-choosing table including module/HTTP layers.
Step 2 — Install and configure
pnpm add -D vitest playwright @vitest/browser-playwright vitest-browser-react \
@equinor/fusion-framework-vitest-plugin-react-app
pnpm exec playwright install chromium
// vitest.config.ts
import { defineProject } from '@equinor/fusion-framework-vitest-plugin-react-app/config';
export default defineProject();
defineProject registers appTestVitePlugin, headless Chromium via Playwright, test-file
inclusion (src/**/*.{test,spec}.{ts,tsx}), and lazy-import warmup. See
references/getting-started-and-configuration.md to merge overrides, replace defaults, or
resolve non-standard app files.
Step 3 — Write the first test
import { expect } from 'vitest';
import { test } from '@equinor/fusion-framework-vitest-plugin-react-app/test';
import { App } from './App';
test('renders the app', async ({ render }) => {
const screen = await render(<App />);
await expect.element(screen.getByRole('heading')).toBeVisible();
});
Always await every Fusion render/hook helper (render, renderHook, renderAppComponent,
renderAppHook) — module initialization completes before the first render.
Step 4 — Compose fixtures for reuse (when several tests share seeded state)
Extend test (from /test) to seed shared state, or use test.override(...) for one file/suite
without creating a new export. See references/fixtures-and-advanced-usage.md for
configureApp/configureFusion/mergeEnvConfig, extend-vs-override, and route/app-lifecycle
tests.
Step 5 — Diagnose failures
Consult references/troubleshooting.md's symptom table before guessing — most failures trace to
an un-awaited render helper, a missing appTestVitePlugin registration, or an HTTP request with
no answering middleware.
Step 6 — Choose Browser Mode or an alternative renderer (only if warranted)
Browser Mode (headless Chromium via Playwright) is the default for fidelity, not speed. Only move
to happy-dom/jsdom for a component/hook provably independent of real browser behavior — see
references/browser-mode-and-migration.md for the tradeoff and the happy-dom wiring.
Step 7 — Migrate an existing suite (when applicable)
See references/browser-mode-and-migration.md for moving an existing
@testing-library/react/jsdom suite onto this package.
Expected output
- A test file using the smallest layer that exercises the behavior under test
vitest.config.tscorrectly registeringappTestVitePlugin(directly or viadefineProject)- Every Fusion render/hook helper awaited
- Fixture composition (
extend/override) used only when reuse across cases/files justifies it - Module-specific mock seeding delegated to
fusion-framework-mocking
Safety & constraints
Never:
- Claim a rendered result is correct without awaiting the render/hook helper first
- Replace a DOM-emulation gap with an untested polyfill or component swap and call the test passing
- Assume an unmatched HTTP request stays offline — an unmatched request reaches the real network
- Invent Vitest/Playwright configuration options not documented in this skill's references
Always:
- Prefer
@equinor/fusion-framework-vitest-plugin-react-app/test'stest/renderfor the normal application path; drop torenderAppHook/renderAppComponent/testApponly when the test must supplyenv/configure/fusionexplicitly - Keep
server.warmup.clientFilesaligned withtest.includewhen test files move - Cite the real export/API used rather than inventing a Fusion-specific test helper
FAQ
What does the fusion-framework-testing skill do?
Guides writing and running Vitest tests for Fusion Framework React apps with @equinor/fusion-framework-vitest-plugin-react-app — choosing a testing layer, configuring vitest.config.ts and Browser Mode, rendering with test/render/renderAppHook/renderAppComponent/testApp fixtures, and troubleshooting or migrating a suite. USE FOR: writing a new app/component/hook test, setting up vitest.config.ts for a Fusion app, choosing between app/framework/module/HTTP test layers, composing or overriding test fixtures, diagnosing a failing Fusion app test. DO NOT USE FOR: seeding module-specific mock state (auth, context, bookmarks, feature flags, HTTP) — use fusion-framework-mocking; dev-server-time API mocking/proxying (use fusion-developer-app); non-Fusion test suites; backend/service-repo tests.
How do I install fusion-framework-testing?
Run npx skills add https://github.com/equinor/fusion-skills --skill fusion-framework-testing in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/fusion-framework-testing/ (personal) or .claude/skills/fusion-framework-testing/ (project).
Which AI agents can use fusion-framework-testing?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is fusion-framework-testing safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains fusion-framework-testing?
It is published by equinor in equinor/fusion-skills. It has 118 recorded installs.
More from equinor/fusion-skills
fusion-issue-authoring
equinor/fusion-skills
Classify issue type, activate the matching agent mode for type-specific drafting, and enforce shared safety gates before GitHub mutation.
fusion-github-review-resolution
equinor/fusion-skills
Resolves unresolved GitHub PR review threads end-to-end: evaluates whether each review comment is correct, applies a targeted fix when valid, replies with rationale when not, commits, and resolves the thread. USE FOR: unresolved review threads, PR review feedback, changes requested PRs, PR review URLs (pullrequestreview-...), fix the review comments, close the open threads, address PR feedback. DO NOT USE FOR: summarizing feedback without code changes, creating new PRs, or read-only branches.
fusion-issue-solving
equinor/fusion-skills
Handles GitHub issue resolution end-to-end for prompts like "solve 123", "lets solve 123", "work on 123", "work on https://github.com/owner/repo/issues/123", or by pasting a direct GitHub issue URL as the request. USE FOR: solve 123, continue work on issue 123, work on https://github.com/owner/repo/issues/123, paste a GitHub issue URL for implementation work. DO NOT USE FOR: issue drafting only, PR review only, or non-implementation research.
fusion-code-conventions
equinor/fusion-skills
Applies and explains code conventions across TypeScript, React, C, and Markdown. Enforces naming rules, file naming patterns, TSDoc and XML doc standards, inline comment intent (the why, not the what), code structure, error handling, async patterns, and dead code policy. Also enforces ADR and contributor doc decisions, and flags decisions that appear stale or misaligned with current tooling. USE FOR: convention questions, code review against project standards, applying naming rules, auditing intent comments, checking TSDoc completeness, enforcing recorded ADR decisions, and flagging stale architectural decisions. DO NOT USE FOR: security vulnerability scanning, performance profiling, runtime debugging, or generating net-new code without a review target.
fusion-dependency-review
equinor/fusion-skills
Review dependency PRs with structured research, existing-PR-discussion capture, multi-lens analysis (security, code quality, impact), and a repeatable verdict template. USE FOR: dependency update PRs, Renovate/Dependabot PRs, library upgrade reviews, "review this dependency PR", "should we merge this update". DO NOT USE FOR: feature PRs, application code reviews, dependency automation/bot configuration, or unattended merge without confirmation.
fusion-mcp
equinor/fusion-skills
Explain what Fusion MCP is and guide users through setting it up when they need Fusion-aware MCP capabilities in Copilot workflows.
Popular testing & qa skills
tdd
mattpocock/skills
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
grilling
mattpocock/skills
Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.
migrate-to-shoehorn
mattpocock/skills
Migrate test files from as type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace as in tests, or needs partial test data.
run-train
lllllllama/rigorpilot-skills
Rigor Train skill for deep learning research repositories. Use when a documented or selected training command should be run conservatively for startup verification, short-run verification, full kickoff, or resume, with command, config, seed, log, checkpoint, status, and metric evidence written to standardized trainoutputs/. Do not use for environment setup, exploratory sweeps, speculative idea implementation, or end-to-end orchestration.
test-driven-development
obra/superpowers
Use when implementing any feature or bugfix, before writing implementation code
finishing-a-development-branch
obra/superpowers
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work