Skip to content
| Marketplace
Sign in
Visual Studio Code>Testing>ngTestFoundryNew to Visual Studio Code? Get it now.
ngTestFoundry

ngTestFoundry

sshyeri

|
2 installs
| (0) | Free
Deterministically generate Angular TestBed specs and Storybook stories from component source.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

ngTestFoundry

Deterministic Angular spec and Storybook scaffold generation for VS Code and Cursor.

ngTestFoundry statically analyzes Angular component source with ts-morph and generates local-only TestBed specs and CSF3 Storybook stories. No component code is sent to a server.

Generate a TestBed spec from a standalone Angular component

Best Fit

ngTestFoundry is strongest today on standalone Angular components that use modern signal APIs: input(), model(), output(), and inject().

Compatibility

  • Target: Angular 17.3 and later standalone components.
  • input() and model() source is supported; Angular 17.3 is the minimum target because generated coverage also recognizes the signal-based output() API.
  • Decorator-based @Input() and @Output() members are also parsed.
  • Specs target Jasmine or Jest. Vitest generation is planned.

Installation

After publication, install from the VS Code Marketplace or run:

code --install-extension sshyeri.ng-test-foundry

For a source checkout before the Marketplace listing is live:

pnpm install
pnpm package
code --install-extension ./ng-test-foundry-0.0.9.vsix

Features

  • Generate one .spec.ts for the active Angular component.
  • Generate one .stories.ts for the active Angular component.
  • Parse constructor DI, inject(), @Input, signal input() / model(), @Output, output(), providers, host directives, class generics, and public method stubs.
  • Warn instead of guessing for uncertain constructs.
  • Batch workspace generation for specs and stories.
  • Custom template override via .ng-test-foundry/templates/spec.eta and .ng-test-foundry/templates/story.eta.

Commands

  • ngTestFoundry: Generate Spec
  • ngTestFoundry: Generate Story
  • ngTestFoundry: Generate Specs for Workspace
  • ngTestFoundry: Generate Stories for Workspace

CLI Helpers

pnpm install
pnpm parse "<glob-or-path>"
pnpm generate both "<component-path>" --write

parse prints one JSON object per @Component, followed by a summary line. generate is a development helper for exercising the same parser/generators outside VS Code.

Custom Templates

Create:

.ng-test-foundry/templates/spec.eta
.ng-test-foundry/templates/story.eta

Template data:

  • it.model: parsed ComponentModel
  • it.framework: jasmine, jest, or unknown
  • it.builtIn: the complete default spec or story string that ngTestFoundry would write when no override exists. Render <%~ it.builtIn %> to keep the default artifact and add project-specific content around it.

You can also point ngTestFoundry.templatesDir at another workspace-relative folder.

Development

pnpm typecheck
pnpm test
pnpm build
pnpm package

The extension bundle is emitted to dist/extension.js.

Current Limits

The reliable path today is deterministic scaffolding for standalone, signal-based Angular components; uncertain analysis is surfaced as an explicit TODO instead of silently guessed.

  • Non-standalone components get a TODO because NgModule graph resolution is not implemented yet.
  • Dependency mocks are shallow; method inference from provider classes is still TODO.
  • Vitest output is not implemented.

Roadmap

  • Resolve NgModule graphs for non-standalone components.
  • Infer richer dependency mocks from provider classes.
  • Add first-class Vitest output.

FAQ

Does my code leave my machine?
No. Parsing and generation are local; component source is not sent to a server.

Why are there TODO comments in generated files?
ngTestFoundry prefers explicit TODOs over pretending uncertain static analysis is complete. Warnings are also summarized in VS Code notifications and batch output.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft