-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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(nx-plugin): properly implement and honor --unitTestRunner #2867
feat(nx-plugin): properly implement and honor --unitTestRunner #2867
Conversation
The failed test passed for me locally, so I'm not sure what's up with that one. I also don't believe I modified any files that would affect that package. |
@devinshoemaker it's a weird test. Sometimes it fails, sometimes it passes 🤷 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -142,4 +142,30 @@ describe('NxPlugin migration', () => { | |||
} | |||
}); | |||
}); | |||
|
|||
describe('--unitTestRunner', () => { | |||
it('should not generate test files', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('should not generate test files', async () => { | |
`describe('none', () => { | |
it('should not generate test files', async () => { |
@@ -161,4 +161,40 @@ describe('NxPlugin plugin', () => { | |||
}) | |||
); | |||
}); | |||
|
|||
describe('--unitTestRunner', () => { | |||
it('should not generate test files', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('should not generate test files', async () => { | |
`describe('none', () => { | |
it('should not generate test files', async () => { |
@@ -107,4 +107,27 @@ describe('NxPlugin schematic', () => { | |||
'my-schematic custom description' | |||
); | |||
}); | |||
|
|||
describe('--unitTestRunner', () => { | |||
it('should generate files', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('should generate files', async () => { | |
`describe('none', () => { | |
it('should not generate test files', async () => { |
Thanks, @FrozenPandaz! I think that suggestion is a better approach. I'll make that change and push up a new commit, and if @Cammisuli has some input then we can go from there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's just one change from me as well. Then everything should be good 😄
options.unitTestRunner === 'none' | ||
? filter(file => !file.endsWith('.spec.tsx')) | ||
: noop(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugin schematic doesn't have any spec files in the template folder. It's just the index.ts
. So this part shouldn't be needed. (If it is needed, it shouldn't have .spec.tsx
😉 )
options.unitTestRunner === 'none' | |
? filter(file => !file.endsWith('.spec.tsx')) | |
: noop(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅 fixed and pushed.
e8b1f11
to
9aeafdb
Compare
Co-Authored-By: Jason Jean <jasonjean1993@gmail.com>
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. |
Current Behavior (This is the behavior we have today, before the PR is merged)
@nrwl/nx-plugin
has aunitTestRunner
property that is not being honored.Expected Behavior (This is the new behavior we can expect after the PR is merged)
@nrwl/nx-plugin
does not generate unit test configurations or files when--unitTestRunner=none
is passed.