+
Skip to content

Docs: Vitest platform browser imports need updating #1855

@adriangonzalezrodrigo

Description

@adriangonzalezrodrigo

I was not able to create a PR:

Update the content of analog/packages/vitest-angular/README.md

from:

If you are using Zoneless change detection, use the following setup:

import '@analogjs/vitest-angular/setup-snapshots';

import {
  provideExperimentalZonelessChangeDetection,
  NgModule,
} from '@angular/core';
import {
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting,
} from '@angular/platform-browser-dynamic/testing';
import { getTestBed } from '@angular/core/testing';

@NgModule({
  providers: [provideExperimentalZonelessChangeDetection()],
})
export class ZonelessTestModule {}

getTestBed().initTestEnvironment(
  [BrowserDynamicTestingModule, ZonelessTestModule],
  platformBrowserDynamicTesting(),
);

to:
If you are using Zoneless change detection, use the following setup:

import '@analogjs/vitest-angular/setup-snapshots';

import {
  provideZonelessChangeDetection,
  NgModule,
} from '@angular/core';
import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';
import { getTestBed } from '@angular/core/testing';

@NgModule({
  providers: [provideZonelessChangeDetection()],
})
export class ZonelessTestModule {}

zoneless is not experimental.

getTestBed().initTestEnvironment(
  [BrowserTestingModule, ZonelessTestModule],
  platformBrowserTesting(),
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载