Skip to content

Conversation

@shairez
Copy link
Contributor

@shairez shairez commented Dec 5, 2025

This implementation has been ported from https://github.com/yjaaidi/vitest-browser-angular to enable inputs passing on render.

CREDIT: @yjaaidi

Copy link

@yjaaidi yjaaidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Thanks for this.
Mostly nitpick that we can fix pre or post-merge.

@@ -1,10 +1,13 @@
import { getTestBed } from "@angular/core/testing";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not replace this whole file with a call to Analog's setupTestBed?
It has all the typical setup to work with or without isolation etc...
https://github.com/analogjs/analog/blob/0b255202253a418f88717c6e178f0bb179725e3c/packages/vitest-angular/setup-testbed.ts#L22?

import { TestBed } from "@angular/core/testing";
import { beforeEach } from "vitest";

setupAngularTestEnvironment();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


export default defineConfig({
plugins: [
angular({ tsconfig: './tsconfig.json' }) as unknown as PluginOption,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't try this locally but this as unknown as PluginOption seems to be related to multiple vite versions incompatibility. Can't we fix that instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants