---
title: createMockAdapter
description: `createMockAdapter(options?)` returns a pure-JavaScript `VGPUAdapter`. Its devices allocate in-memory buffers backed by `Uint8Array`, making core testable without Dawn or native GPU libraries.
---

# createMockAdapter



`options.features` declares the optional features the mock adapter supports (its
equivalent of `GPUAdapter.features`); it defaults to none. `requestDevice` rejects a
`requiredFeatures` entry outside that set with `VGPU-FEATURE-UNSUPPORTED`, and —
faithful to WebGPU — the created device's `features` holds exactly the requested
features, not the adapter's full set. This lets tests exercise feature-gated code
paths (e.g. `"depth-clip-control"`) both with and without the feature granted.


---

For a semantic overview of all documentation, see [/sitemap.md](/sitemap.md)

For an index of all available documentation, see [/llms.txt](/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/agents.md](/agents.md)