Skip to content

fix(@angular-devkit/build-angular): update karma builder to use non-deprecated API #20485

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 1 commit into from
Apr 9, 2021
Merged

fix(@angular-devkit/build-angular): update karma builder to use non-deprecated API #20485

merged 1 commit into from
Apr 9, 2021

Conversation

alan-agius4
Copy link
Collaborator

With this change we update the Karma builder to use the new Server API.

Closes: #20479

@google-cla google-cla bot added the cla: yes label Apr 9, 2021
@alan-agius4 alan-agius4 added the target: major This PR is targeted for the next major release label Apr 9, 2021
@alan-agius4 alan-agius4 requested a review from clydin April 9, 2021 11:35
// Cleanup, signal Karma to exit.
return () => {
// Karma only has the `stop` method start with 3.1.1, so we must defensively check.
const karmaServerWithStop = (karmaServer as unknown) as { stop: () => Promise<void> };
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I guess this is no longer relevant. Maybe fix in the follow-up PR?

// Workaround for https://github.com/karma-runner/karma/issues/3154
// When this workaround is removed, user projects need to be updated to use a Karma
// version that has a fix for this issue.
toJSON: () => { },
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: The issue has been fixed a while ago, so maybe cleanup in the follow-up PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will do

logger: context.logger,
};

// @types/karma don't include the last parameter.
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI I'm working on the fix for this and other issues in @types/karma. Should have a PR up soon.

Copy link
Contributor

Choose a reason for hiding this comment

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

…eprecated API

With this change we update the Karma builder to use the new Server API.

Closes: #20479
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Apr 9, 2021
@clydin clydin merged commit f145312 into angular:master Apr 9, 2021
@alan-agius4 alan-agius4 deleted the karma-deprecated-api branch April 9, 2021 17:44
@erikhorlings
Copy link

Hey all,
Just wanted to say thanks for the work you put in.

@erikhorlings
Copy link

Is this change limited to the newest v12, or can it also be merged to the 11.2.x branch?

@alan-agius4
Copy link
Collaborator Author

@erikhorlings, this change is only merged in version 12.

@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 May 13, 2021
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 target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Karma test runner uses deprecated parameters to start Karma server
4 participants