Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 of 15 tasks
prabh-62 opened this issue Jul 3, 2021 · 2 comments · Fixed by #21300
Closed
2 of 15 tasks

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

prabh-62 opened this issue Jul 3, 2021 · 2 comments · Fixed by #21300
Labels
area: @schematics/angular feature Issue that requests a new feature
Milestone

Comments

@prabh-62
Copy link

prabh-62 commented Jul 3, 2021

🚀 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?

@alan-agius4
Copy link
Collaborator

This definitely makes sense for new applications since eventually we’d like this to be the default.

@alan-agius4 alan-agius4 added area: @schematics/angular feature Issue that requests a new feature labels Jul 5, 2021
@ngbot ngbot bot added this to the Backlog milestone Jul 5, 2021
@alan-agius4 alan-agius4 changed the title Faster tests: Destroy test module after every test by default in v13 Faster tests: Destroy test module after every test by default Jul 7, 2021
clydin pushed a commit that referenced this issue Jul 7, 2021
In version 12.1, the framework added the `destroyAfterEach` an opt-in feature that improves tests performance and also addresses two long-standing issues.

The idea, is to have this enabled by default in the future.  Related PR: angular/angular#42566

Closes #21280
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @schematics/angular feature Issue that requests a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants