ngTestFoundry
Generate Angular TestBed specs and Storybook stories from component source
without sending code to a server.
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. The core single-file generators are free; Pro unlocks
workflow-scale features for teams and larger workspaces.

Best Fit
ngTestFoundry is strongest today on standalone Angular components that use
modern signal APIs: input(), model(), output(), and inject().
Use it when you want a deterministic starting point for specs or stories without
hand-writing the same TestBed setup, inputs, providers, and Storybook args every
time.
Free vs Pro
| Capability |
Free |
Pro |
| Generate a spec for the active component |
Yes |
Yes |
| Generate a Storybook story for the active component |
Yes |
Yes |
Parse Angular DI, inject(), @Input, input(), model(), @Output, and output() |
Yes |
Yes |
| Batch-generate specs across a workspace |
No |
Yes |
| Batch-generate stories across a workspace |
No |
Yes |
| Use custom Eta templates |
No |
Yes |
Pro is for workflow scale. It does not change the generator's current static
analysis limits; check Current Limits before buying.
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, this creates a
local development build. Pro purchase commands require a configured Pro release
build.
pnpm install
pnpm package
code --install-extension ./ng-test-foundry-0.1.1.vsix
What The Free Version Does
- 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.
What Pro Adds
- Batch workspace generation for specs and stories.
- Custom template override via
.ng-test-foundry/templates/spec.eta and
.ng-test-foundry/templates/story.eta.
Pro is useful when you want to seed tests or stories across many components, or
when your team wants generated artifacts to follow a shared internal template.
Commands
ngTestFoundry: Generate Spec
ngTestFoundry: Generate Story
ngTestFoundry: Generate Specs for Workspace (Pro)
ngTestFoundry: Generate Stories for Workspace (Pro)
ngTestFoundry: Buy Pro
ngTestFoundry: Activate Pro License
ngTestFoundry: Show Pro License Status
ngTestFoundry: Deactivate Pro License
Pro Purchase And Activation
Pro is sold through Lemon Squeezy and unlocked with a license key.
- Run
ngTestFoundry: Buy Pro to open the hosted Lemon Squeezy checkout.
- Complete checkout and copy the license key from the receipt.
- Run
ngTestFoundry: Activate Pro License in VS Code.
The extension stores the license key in VS Code SecretStorage, validates it with
Lemon Squeezy at most every 72 hours, and verifies that the key belongs to the
configured ngTestFoundry store, product, and variant before enabling Pro
features.
Feedback And Support
Website:
https://sshyeri.github.io/ng-test-foundry-public/
Use the public docs/support repository for issues, feedback, roadmap notes, and
license help:
https://github.com/sshyeri/ng-test-foundry-public
Do not paste license keys or private component source into public issues.
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 (Pro)
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.
Pro release builds require Lemon Squeezy product details to be baked into the
extension bundle:
NGTF_PRO_CHECKOUT_URL="https://<store>.lemonsqueezy.com/checkout/buy/<id>"
NGTF_LEMON_STORE_ID="<store-id>"
NGTF_LEMON_PRODUCT_ID="<product-id>"
NGTF_LEMON_VARIANT_IDS="<variant-id>[,<variant-id>]"
pnpm package:pro
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
Why are commands missing in Restricted Mode?
Buying, activating, and checking Pro status work in Restricted Mode. Generation
commands require Workspace Trust because they read component source and write
generated files.
What does Pro unlock?
Pro unlocks workflow-scale features: workspace batch generation and custom
templates. The generated output uses the same parser and generator as the free
single-component commands.
Can I move my Pro license to another machine?
Use ngTestFoundry: Deactivate Pro License on the old machine, then activate on
the new one with the same Lemon Squeezy license key. Activation limits are
managed by Lemon Squeezy.
Does my code leave my machine?
No. Parsing and generation are local; component source is not sent to a server.
License activation and validation contact Lemon Squeezy with the license key and
machine activation instance, not component source.
Does Pro make generated tests complete?
No. Pro adds scale and customization features. ngTestFoundry still prefers
explicit TODOs over silently guessing when static analysis is uncertain.
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.