Skip to content

Faster tests: Destroy test module after every test by default #21280

Closed
@prabh-62

Description

@prabh-62

🚀 Feature request

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Description

❯ npx @angular/cli@12 new web-apps --create-application falsecd web-apps && yarn ng g app admin-console --routing --style scss
  • Edit projects/admin-console/src/test.ts and update TestEnvironmentOptions
getTestBed().initTestEnvironment(
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting(),
  { teardown: { destroyAfterEach: true } }
);

Describe the solution you'd like

The third argument { teardown: { destroyAfterEach: true } } should be applied by default when creating application/library.

Describe alternatives you've considered

N/A

Relevant blog post: What's new in Angular 12.1?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions