Skip to content

Make karma main file optional#23957

Merged
alan-agius4 merged 2 commits into
angular:mainfrom
alan-agius4:make-karma-main-file-optional
Sep 27, 2022
Merged

Make karma main file optional#23957
alan-agius4 merged 2 commits into
angular:mainfrom
alan-agius4:make-karma-main-file-optional

Conversation

@alan-agius4
Copy link
Copy Markdown
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 Label used to distinguish feature request from other issues 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
Copy Markdown
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
Copy Markdown

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 Label used to distinguish feature request from other issues 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