Skip to content

Make karma main file optional #23957

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

Merged
merged 2 commits into from
Sep 27, 2022

Conversation

alan-agius4
Copy link
Collaborator

feat(@schematics/angular): remove test.ts file from new projects

The test.ts is now included in @angular-devkit/build-angular and unless this needs to be customized is no longer needed to be provided.


feat(@angular-devkit/build-angular): karma builder main option is now optional

The Karma builder main option is now optional. The default test bootstrapping is injected automatically in the bundle.

@alan-agius4 alan-agius4 added state: blocked target: major This PR is targeted for the next major release labels Sep 26, 2022
@angular-robot angular-robot bot added the feature Issue that requests a new feature label Sep 26, 2022
@alan-agius4 alan-agius4 force-pushed the make-karma-main-file-optional branch 3 times, most recently from 73f6a1e to 1b64266 Compare September 26, 2022 17:18
@alan-agius4 alan-agius4 force-pushed the make-karma-main-file-optional branch 4 times, most recently from 2a3335d to f1f1634 Compare September 27, 2022 08:59
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 27, 2022
@alan-agius4 alan-agius4 added this to the v15 Feature Freeze milestone Sep 27, 2022
@alan-agius4 alan-agius4 marked this pull request as ready for review September 27, 2022 14:22
@alan-agius4 alan-agius4 requested a review from clydin September 27, 2022 14:22
Copy link
Member

@clydin clydin left a comment

Choose a reason for hiding this comment

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

LGTM.

Can you add the content of the internal test.ts file to one of the commit messages to improve the discoverability?

…ow optional

The Karma builder `main` option is now optional. The default test bootstrapping is injected automatically in the bundle.
The test.ts is now included in `@angular-devkit/build-angular` and unless this needs to be customized is no longer needed to be provided.

Default config:
```js
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import { getTestBed } from '@angular/core/testing';
import {
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
  errorOnUnknownElements: true,
  errorOnUnknownProperties: true
});
```
@alan-agius4 alan-agius4 force-pushed the make-karma-main-file-optional branch from f1f1634 to 6c98b4a Compare September 27, 2022 16:30
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 27, 2022
@alan-agius4 alan-agius4 merged commit 56a1e8f into angular:main Sep 27, 2022
@alan-agius4 alan-agius4 deleted the make-karma-main-file-optional branch September 27, 2022 16:59
@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 Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker feature Issue that requests a new feature target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants