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(nx-plugin): properly implement and honor --unitTestRunner #2867

Merged
merged 4 commits into from
Apr 27, 2020

Conversation

devinshoemaker
Copy link
Contributor

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

@nrwl/nx-plugin has a unitTestRunner 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.

@Cammisuli Cammisuli self-requested a review April 17, 2020 12:28
@devinshoemaker
Copy link
Contributor Author

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.

@Cammisuli
Copy link
Member

@devinshoemaker it's a weird test. Sometimes it fails, sometimes it passes 🤷

Copy link
Collaborator

@FrozenPandaz FrozenPandaz left a comment

Choose a reason for hiding this comment

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

Thank you!

Needs some minor cleanup but LGTM other wise!

@Cammisuli what do you think?

@@ -142,4 +142,30 @@ describe('NxPlugin migration', () => {
}
});
});

describe('--unitTestRunner', () => {
it('should not generate test files', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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 () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
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 () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
it('should generate files', async () => {
`describe('none', () => {
it('should not generate test files', async () => {

@devinshoemaker
Copy link
Contributor Author

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.

Copy link
Member

@Cammisuli Cammisuli left a 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 😄

Comment on lines 119 to 121
options.unitTestRunner === 'none'
? filter(file => !file.endsWith('.spec.tsx'))
: noop(),
Copy link
Member

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 😉 )

Suggested change
options.unitTestRunner === 'none'
? filter(file => !file.endsWith('.spec.tsx'))
: noop(),

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😅 fixed and pushed.

Co-Authored-By: Jason Jean <jasonjean1993@gmail.com>
@Cammisuli Cammisuli merged commit d3b5d1f into nrwl:master Apr 27, 2020
@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

3 participants