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

fix(schematics): migrate spec to skipTest to be in line with Angular CLI #2253

Merged
merged 4 commits into from
Jan 16, 2020

Conversation

Jefiozie
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

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

What is the current behavior?

You need to use the spec option for generating test files.

Closes #2242

What is the new behavior?

We are now inline with the Angular CLI skipTest option.

Does this PR introduce a breaking change?

[X] Yes
[ ] No

Other information

@Jefiozie
Copy link
Contributor Author

cc: @timdeschryver

@ngrxbot
Copy link
Collaborator

ngrxbot commented Nov 13, 2019

Preview docs changes for 866ecc2 at https://previews.ngrx.io/pr2253-866ecc2/

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

I found another usage of spec at schematics-core/testing/create-workspace

const defaultModuleOptions = {
  name: 'foo',
  spec: true,
  module: undefined,
  flat: false,
};

I think this const isn't used, so you can remove the whole declaration. After that you'll have to run npm run copy:schematics.

Could you also update the docs please? If you search on --spec in the ngrx.io folder, you will find all occurrences.

@Jefiozie
Copy link
Contributor Author

Thanks for looking into it I will update the PR soon with your findings.

@timdeschryver timdeschryver added the Needs Cleanup Review changes needed label Nov 13, 2019
@Jefiozie
Copy link
Contributor Author

So I changed as I believe the correct things now and made updates to the docs. Hope that these are the correct changes.

@Jefiozie
Copy link
Contributor Author

Okay, I don't exactly know why the bazel tests are failing. Is it because of my changes?

@@ -16,7 +16,7 @@ export default function(options: FeatureOptions): Rule {
name: options.name,
path: options.path,
project: options.project,
spec: false,
skipTest: true,
Copy link
Member

Choose a reason for hiding this comment

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

Not for now, but could we introduce a skipTest flag for the feature schematic @brandonroberts ?
By default, we create spec files for every schematic, but not for this schematic.

@timdeschryver
Copy link
Member

@Jefiozie I don't think it's because of the changes, let me re-trigger the CI

@timdeschryver timdeschryver added Breaking Change and removed Needs Cleanup Review changes needed labels Nov 14, 2019
Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

Could you revert the changes made in docs/* please, these are the docs for v4-6 - and are working with previous versions of Angular. Thus, here it will remain spec.

@Jefiozie
Copy link
Contributor Author

Reverted the docs changes, I think we are good now for this PR 👍

@timdeschryver timdeschryver added 9.x and removed Needs Cleanup Review changes needed labels Nov 14, 2019
@timdeschryver
Copy link
Member

@Jefiozie could you also add a breaking change note to the PR please, you can find a template in CONTRIBUTING.MD

@Jefiozie
Copy link
Contributor Author

I added the breaking changes request.

@brandonroberts
Copy link
Member

@Jefiozie will you resolve the merge conflicts? Thanks!

@brandonroberts brandonroberts added the Needs Cleanup Review changes needed label Jan 7, 2020
@Jefiozie
Copy link
Contributor Author

Jefiozie commented Jan 9, 2020

I did the merge on my tablet I see that there are problems. Will fix this later this week.

@Jefiozie
Copy link
Contributor Author

@brandonroberts, I merged all the latest changes into my branch. At first I thought the failing tests where because of my changes however I believe that it is because of recent changes in the master branch around #2301.

Could you o maybe @alex-okrushko verify this? (would love to know this for sure 😄 )

@timdeschryver
Copy link
Member

I also noticed the failing build, should be resolved if #2313 is merged.

@Jefiozie
Copy link
Contributor Author

Thanks @timdeschryver

@Jefiozie
Copy link
Contributor Author

@brandonroberts i think it's good to merge now.

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

@Jefiozie can you rebase please (in order to keep the CI happy)?

Closes: ngrx#2242

BREAKING CHANGES:

To be inline with the Angular CLI, we migrated the `--spec` to `--skipTest`.
By default skipTest is false, this way you will always be provided with `*.spec.ts files`

BEFORE:

```sh

ng generate action User --spec

```

AFTER:

```sh

ng generate action User

```
@Jefiozie
Copy link
Contributor Author

@timdeschryver, I believe it should be correct now.

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

Thanks @Jefiozie

@brandonroberts brandonroberts merged commit 714ae5f into ngrx:master Jan 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Schematics: use skipTests instead of spec
4 participants