Skip to workspace
PixelOkay
Local-first
Tools

PIXELOKAY / DEVELOPER TOOLS

Unit Test Generator

Inspect functions, translate concrete examples into assertions, and scaffold realistic edge-case tests—without uploading code to a server.

JavaScript / TypeScriptPythonZIP projectsOptional on-device AI
QUICK START

Import up to 150 source files. Zip extraction never runs imported code.

Generated tests are drafts, not proof of correctness. Only explicit examples can produce asserted expectations; other cases stay TODO/skipped for review. This tool does not execute untrusted project code. The optional browser AI is experimental, may download a model, and can suggest inaccurate tests.
2 / CONFIGURE

What should we test?

Use functionName(arg1, arg2) => expected for concrete assertions. Literals: numbers, quoted strings, JSON arrays/objects, booleans, null. Use => throws TypeError or => raises ValueError for specific errors. For duplicate names, use src/math.js::add(2,3) => 5. All other prose provides context but does not invent expected outputs.

Detected top-level functions

Add source code to discover functions.

No functions detected

AST-style heuristics, not full compiler parsing.

3 / REVIEW & EXPORT

Generated tests

0 assertions0 TODOs

Generate tests to see compatibility and review warnings.

Generate usable tests, not false confidence.

Review every assertion

Assertions are based only on the examples you provide. Missing cases become visible TODO or skipped tests, not fabricated successes.

Keep the code private

Source inspection, test scaffolding and ZIP packaging run in the browser. Optional browser AI stays on device when the browser supports it.

Bring your own project

Import a folder of source files via multi-select or ZIP, edit individual sources, and export the generated tests alongside source files for integration.

LOCAL AI SETUP

Set up AI on this device

First, a model needs to be loaded on your device

Unit Test Generator can refine its editable test drafts locally. WebGPU models may download hundreds of megabytes after you click Download & Load. Cached files may be reused if compatible with AI Chat; your source is not uploaded for inference.

  1. 1. Check device
  2. 2. Download / cache
  3. 3. Set up assistant
  4. 4. Generate tests

Device & model resources

Estimates, not live RAM readings
Device RAM / model memoryNot measured

Live model RAM is unavailable in most browsers.

Browser website storageChecking storage…

Browser storage is not RAM.

ONE ACTION · ALL RECOGNIZED AI MODEL DOWNLOADS

Free AI model storage across PixelOkay

Scan this website origin for positively identified WebLLM and Transformers.js model files inside accessible Cache Storage buckets. This includes other PixelOkay tools, not just this one. Unknown buckets, site data and browser databases are never cleared automatically.

Run a scan to inspect safely recognized cache artifacts.

Browser-native AI and unknown IndexedDB/OPFS caches cannot be deleted here. Other open AI tabs may repopulate removed files; close them before cleanup.

Having trouble downloading or loading AI?

Refresh storage, check device compatibility, retry setup or choose a smaller model. Only confirmed model-cache artifacts are eligible for targeted cleanup. Clearing all website data may delete chats, projects, drafts and other saved work; this tool never does that.

Choose a model, then load it only when you need AI.
Currently loadedNo active inference sessionDeterministic test generation is available without AI.
MODEL-ONLY CACHE CLEANUP

Delete recognized model artifacts?

Removing these shared artifacts may require AI Chat and other PixelOkay tools to download models again. Unknown site data, user files, browser databases and conversations will not be targeted.

Generate and review unit test drafts

Import supported JavaScript, TypeScript or Python source, select discovered functions, and describe concrete inputs and expected outputs. The generator drafts tests for review; it does not execute your source.

  1. Paste source files or open a supported project ZIP, then inspect the function names the source scanner detects.
  2. Select functions and provide specific example inputs, expected results or expected errors. Choose a test runner and generate the draft.
  3. Review assertions, warnings and TODO cases, edit the output, then download test files or a ZIP for use in your own project.

Example: For a clamp function, specify that input -2 with bounds 0 and 10 should return 0, and input 12 should return 10. Check both generated assertions against the function’s real specification before running them in your project.

Limits and privacy: Function discovery is heuristic, not a compiler. Unsupported semantics remain TODO or skipped, and imported source is not run inside the tool. Generated tests can import and execute project code when run elsewhere. Optional AI refinement depends on browser support, device resources and model setup; source files are not sent to a remote AI service.

Related tools