Skip to content

refactor(@angular-devkit/build-angular): simplify how specs are found and loaded #23939

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
Sep 23, 2022

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Sep 21, 2022

Prior to this change specs where found and loaded using Webpack's require.context API. The require.context is found in the users project test.ts. This resulted in a complex and hacky setup especially to filter tests when the include builder option is provided, were we had to amend the test.ts in memory.

With this change we find all the specs files and add them as part of the main entrypoint.

Closes #23751 and closes #22531

@alan-agius4 alan-agius4 force-pushed the test-specs-entrypoint branch 3 times, most recently from 0e2c0a5 to 375c0f8 Compare September 22, 2022 07:43
@alan-agius4 alan-agius4 marked this pull request as ready for review September 22, 2022 14:02
@alan-agius4 alan-agius4 requested a review from clydin September 22, 2022 14:02
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release labels Sep 22, 2022
@alan-agius4 alan-agius4 added this to the v15 Feature Freeze milestone Sep 22, 2022
… and loaded

Prior to this change specs where found and loaded using Webpack's `require.context` API. The `require.context` is found in the users project `test.ts`. This resulted in a complex and hacky setup especially to filter tests when the `include` builder option is provided, were we had to amend the `test.ts` in memory.

With this change we find all the specs files and add them as part of the main entrypoint.

Closes angular#23751 and closes angular#22531
@clydin clydin 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 23, 2022
@clydin clydin merged commit dbcea96 into angular:main Sep 23, 2022
@alan-agius4 alan-agius4 deleted the test-specs-entrypoint branch September 24, 2022 05:15
@vigie
Copy link

vigie commented Oct 4, 2022

Is it possible to backport this to the 14 branch so we can consume the fix to #23751?

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

Successfully merging this pull request may close these issues.

ng test exits with success even if test code does not compile Running tests with code coverage doesn't include files outside the sourceRoot directory
3 participants