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(testing): update to jest-preset-angular v8.0.0 #1986

Conversation

JoshMentzer
Copy link

Current Behavior (This is the behavior we have today, before the PR is merged)

  • jest-preset-angular is v7.0.0
  • Upgrading jest-preset-angular to v8.0.0 causes any tests for Angular projects using Jest to fail to run

Expected Behavior (This is the new behavior we can expect after the PR is merged)

  • jest-preset-angular is v8.0.0
  • Tests for Angular projects using Jest should execute successfully

Issue

#1979

@@ -69,7 +69,10 @@ function run(
require.resolve('jest-preset-angular');
Object.assign(tsJestConfig, {
Copy link
Contributor

@minijus minijus Oct 24, 2019

Choose a reason for hiding this comment

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

Right now it is not possible to modify these options from local workspace config. Would it make sense having jest.config.js and jest-ng.config.js in root dir of workspace?

jest-ng.config.js:

module.exports = {
  preset: './jest.config.js',
  stringifyContentPathRegex: '\\.(html|svg)$',
  astTransformers: [
    'jest-preset-angular/build/InlineFilesTransformer',
    'jest-preset-angular/build/StripStylesTransformer'
  ],
  snapshotSerializers: [
    'jest-preset-angular/build/AngularSnapshotSerializer.js',
    'jest-preset-angular/build/HTMLCommentSerializer.js'
  ]
};

and then libs/dummy/jest.config.js:

module.exports = {
  name: 'dummy',
  preset: '../../jest-ng.config.js',
  coverageDirectory: '../../coverage/libs/dummy'
};

Copy link
Author

Choose a reason for hiding this comment

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

I can see the sense of your suggestion, think that's more of a design decision would want maintainers to weigh in on; may also be more of its own PR vs part of this one as this is focused on just updating a dependency, like for like.

@JoshMentzer
Copy link
Author

I'm unsure why the yarn.lock changes other than as it regards to the new jest-preset-angular; after cloning and doing yarn majority of those changes showing up without modification to package.json

Updates to jest-preset-angular to v8.0.0, includes migrations to fix any existing projects affected
by the jest-preset-angular update.

closes nrwl#1979
@JoshMentzer JoshMentzer force-pushed the feat(testing)-update-jest-preset-angular branch from ae166c3 to 653eda7 Compare October 24, 2019 16:23
@wtho
Copy link

wtho commented Oct 26, 2019

jest-preset-angular maintainer here.
We added a new Serializer, which serializes components in a nicer way, stripping away dev-only ng-* attributes. I do not know if it should be enabled in nx by default, but we generally do recommend to enable it from our side.

Just throwing this in here, could also happen in a different PR of course.

Cheers!

@vsavkin
Copy link
Member

vsavkin commented Nov 3, 2019

@JoshMentzer thank you for your PR. Could you integrate the new serializer in this PR?

@JoshMentzer
Copy link
Author

@JoshMentzer thank you for your PR. Could you integrate the new serializer in this PR?

Sure thing, can probably do that later tonight.

@listepo
Copy link

listepo commented Nov 20, 2019

@JoshMentzer any news?

@edbzn
Copy link
Contributor

edbzn commented Nov 24, 2019

Hi, waiting this to migrate.

@vsavkin
Copy link
Member

vsavkin commented Dec 2, 2019

@JoshMentzer any update?

@vandermore
Copy link

This is a much needed update for the project I am on right now. Any update on the status?

@JoshMentzer
Copy link
Author

Hey all, sorry for long delay on getting this updated to include the new serializer; I plan on getting it in this week

@mehrad-rafigh
Copy link
Contributor

Hi @JoshMentzer Are you able to integrate the changes into your PR? Otherwise, I would open a PR, because we really need that feature and cannot really wait for any longer

@wtho
Copy link

wtho commented Dec 16, 2019

Maybe JoshMentzer can add you as collaborator on his fork, so you can add a commit to the branch?

@demisx
Copy link

demisx commented Dec 27, 2019

Any update please? It's blocking our work too.

@overlineink
Copy link

Hey @demisx 👋, according with the issue, you can performe the changes available in this PR locally till it get passed.

@overlineink
Copy link

@JoshMentzer 👋 I hope are you doing well! Are you working on it? If not maybe some of us are free to help solve the conflicts.

@mehrad-rafigh
Copy link
Contributor

Hi everyone, I opened a new PR addressing this issue.

@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet