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

tests: add e2e tests for plugin #1478

Merged
merged 38 commits into from
May 13, 2020
Merged

tests: add e2e tests for plugin #1478

merged 38 commits into from
May 13, 2020

Conversation

anshumanv
Copy link
Member

What kind of change does this PR introduce?
test

Did you add tests for your changes?
Yes

If relevant, did you update the documentation?
NA

Summary

  • Add e2e tests for plugin

Does this PR introduce a breaking change?
No

Other information

  • Any other cases to be tested are appreciated.

Did some util changes in #1476 , this should go after that.

@anshumanv anshumanv closed this Apr 18, 2020
@anshumanv anshumanv reopened this Apr 18, 2020
@anshumanv anshumanv marked this pull request as ready for review April 18, 2020 16:58
@anshumanv anshumanv requested a review from a team as a code owner April 18, 2020 16:58
@anshumanv
Copy link
Member Author

Ahh, looking at tests

@alexander-akait
Copy link
Member

@anshumanv strange, CI green

@anshumanv
Copy link
Member Author

anshumanv commented Apr 20, 2020

@evilebottnawi I removed checks for yarn.lock(from both init and loader as either of them fails if checked), fails otherwise 😭

@alexander-akait
Copy link
Member

@anshumanv problems only locally?

@anshumanv
Copy link
Member Author

@evilebottnawi only in MacOS CI, passes locally on MacOS

Copy link
Member

@rishabh3112 rishabh3112 left a comment

Choose a reason for hiding this comment

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

Instead of yarn.lock, you can check for existence of node_modules folder. yarn.lock is there for checking whether packages are installed or not by the generator in the end. I think it would help for now.

@anshumanv
Copy link
Member Author

Instead of yarn.lock, you can check for existence of node_modules folder. yarn.lock is there for checking whether packages are installed or not by the generator in the end. I think it would help for now.

Let me see if that works. 👍

@webpack-bot
Copy link

@anshumanv Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@rishabh3112 Please review the new changes.

alexander-akait
alexander-akait previously approved these changes May 7, 2020
Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

/cc @webpack/cli-team

snitin315
snitin315 previously approved these changes May 7, 2020
Copy link
Member

@rishabh3112 rishabh3112 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Left a few suggestions.

@@ -33,7 +33,7 @@ describe('init auto flag', () => {
expect(stdout).not.toContain(firstPrompt);

// Test regressively files are scaffolded
const files = ['./sw.js', './package.json', './yarn.lock', './src/index.js'];
const files = ['./sw.js', './package.json', './src/index.js'];
Copy link
Member

Choose a reason for hiding this comment

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

This change is not needed now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Needed, these are still randomly failing.

Copy link
Member

Choose a reason for hiding this comment

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

Then add a check for node_modules folder, we need to check whether packages are installed or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, I hope it stays consistent now.

Copy link
Member Author

Choose a reason for hiding this comment

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

Tried adding node_modules, same behaviour, would need debugging later.

@@ -28,7 +28,7 @@ describe('init', () => {
expect(stdout).toContain(firstPrompt);

// Test regressively files are scaffolded
const files = ['./sw.js', './package.json', './yarn.lock', './src/index.js'];
const files = ['./sw.js', './package.json', './src/index.js'];
Copy link
Member

Choose a reason for hiding this comment

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

Same here

Copy link
Member Author

Choose a reason for hiding this comment

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

^ Same

@anshumanv
Copy link
Member Author

/cc @evilebottnawi @rishabh3112

const pluginPath = join(__dirname, pluginName);

// Since scaffolding is time consuming
jest.setTimeout(200000);
Copy link
Member

Choose a reason for hiding this comment

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

Why number is so big?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll reduce this, maybe I was testing

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

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

/cc @webpack/cli-team

@anshumanv anshumanv merged commit 6a8dd32 into webpack:next May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants