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

feat(spectacular)!: add required routes option and optional testing features for provideSpectacularFeatureTest #76

Merged

Conversation

LayZeeDK
Copy link
Member

@LayZeeDK LayZeeDK commented Jul 31, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines: CONTRIBUTING.md#commit
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Features

  1. provideSpectacularFeatureTest only supports the featurePath option
  2. provideSpectacularFeatureTest returns Provider[]
  3. provideSpectacularFeatureTest is stable and provideSpectacularFeatureTesting does not exist
  4. withInitialFeatureNavigation does not exist
  5. SpectacularFeatureTestingModule is stable

Refactors

  1. SpectacularFeatureTestingRootModule uses InjectFlags

Testing

  1. A classic CapitalizePipe is tested

Documentation

  1. The excludeComponentDeclaration option is specified for all Angular Testing Library example tests

Issue Number: N/A

What is the new behavior?

Features

  1. provideSpectacularFeatureTest requires a routes option and optionally accepts the withInitialFeatureNavigation feature and Angular Router features
  2. provideSpectacularFeatureTest returns (EnvironmentProviders | Provider)[]
  3. provideSpectacularFeatureTest is marked as deprecated and a copy is renamed to provideSpectacularFeatureTesting
  4. Add withInitialFeatureNavigation for use with provideSpectacularFeatureTest and provideSpectacularFeatureTesting
  5. SpectacularFeatureTestingModule is deprecated

Refactors

  1. SpectacularFeatureTestingRootModule uses InjectOptions

Testing

  1. A classic and a standalone CapitalizePipe are tested

Documentation

  1. The excludeComponentDeclaration option is not mentioned in Angular Testing Library example tests

Does this PR introduce a breaking change?

[x] Yes
[ ] No

BREAKING CHANGES

  • A routes option must be passed to provideSpectacularFeatureTest.
  • provideSpectacularFeatureTest returns (EnvironmentProviders | Provider)[]

DEPRECATIONS

  • provideSpectacularFeatureTest is to be removed in Spectacular version 16. Migrate to provideSpectacularFeatureTesting.
  • SpectacularFeatureTestingModule is to be removed in Spectacular version 16. Migrate to provideSpectacularFeatureTesting.

Other information

API design Gist

@LayZeeDK LayZeeDK force-pushed the spectacular/feat/support-feature-providers-for-feature-tests branch 2 times, most recently from 6820068 to 2a8f9d8 Compare July 31, 2023 22:44
@NachoVazquez
Copy link
Contributor

It is looking great; I'm excited.

@LayZeeDK LayZeeDK force-pushed the spectacular/feat/support-feature-providers-for-feature-tests branch 3 times, most recently from 26c9eed to 4e2e709 Compare July 31, 2023 23:55
@LayZeeDK LayZeeDK force-pushed the spectacular/feat/support-feature-providers-for-feature-tests branch from 4e2e709 to 10d6fef Compare August 1, 2023 00:05
… features for `provideSpectacularTest`

Give `provideSpectacularFeatureTest` feature-parity with `SpectacularFeatureTestingModule`.

BREAKING CHANGES
The required `routes` option is added to `provideSpectacularFeatureTest`.
@LayZeeDK LayZeeDK force-pushed the spectacular/feat/support-feature-providers-for-feature-tests branch from 10d6fef to e639253 Compare August 1, 2023 00:08
@LayZeeDK LayZeeDK marked this pull request as ready for review August 1, 2023 00:10
…ectacularFeatureTestingOptions`, and `withInitialFeatureNavigation` to readme
@LayZeeDK LayZeeDK force-pushed the spectacular/feat/support-feature-providers-for-feature-tests branch from e639253 to 73bee63 Compare August 1, 2023 00:18
Copy link
Contributor

@NachoVazquez NachoVazquez left a comment

Choose a reason for hiding this comment

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

I left some small nitpicks assisted by the linter, but it looks great!

@LayZeeDK LayZeeDK merged commit 5aad619 into main Aug 8, 2023
6 checks passed
@LayZeeDK LayZeeDK deleted the spectacular/feat/support-feature-providers-for-feature-tests branch August 8, 2023 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants