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

chore: Add a test covering wxt init in a non-empty directory #563

Merged
merged 3 commits into from
Mar 24, 2024

Conversation

btea
Copy link
Contributor

@btea btea commented Mar 23, 2024

Supplement #556

Copy link

netlify bot commented Mar 23, 2024

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 95a9a2b
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/660043202564a800082f436e
😎 Deploy Preview https://deploy-preview-563--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Comment on lines 49 to 52
await execaCommand(`pnpm -s wxt init ${project.root} -t vue --pm npm`, {
env: { ...process.env, CI: 'true' },
stdio: 'ignore',
});
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
await execaCommand(`pnpm -s wxt init ${project.root} -t vue --pm npm`, {
env: { ...process.env, CI: 'true' },
stdio: 'ignore',
});
await fs.writeJson(project.resolve('package.json'), {});

Init E2E tests are slow, so rather than bootstrapping twice, creating a single file in the directory would speed them up.

Specifically, I've had problems with init tests timing out in GitHub actions when ran on windows. The install step is super slow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense.

However, the project.resolve method does not exist, I replaced it with project.resolvePath. And there is still a problem after the replacement, fs.writeJSON will throw an error, No such file...

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh yeah, it's resolvePath. The no such file error was because the project directory didn't exist yet.

Copy link

codecov bot commented Mar 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.49%. Comparing base (05db264) to head (95a9a2b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #563      +/-   ##
==========================================
+ Coverage   86.40%   86.49%   +0.09%     
==========================================
  Files         111      111              
  Lines        8877     8874       -3     
  Branches      878      879       +1     
==========================================
+ Hits         7670     7676       +6     
+ Misses       1193     1184       -9     
  Partials       14       14              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@aklinker1 aklinker1 left a comment

Choose a reason for hiding this comment

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

I updated the test

@aklinker1 aklinker1 changed the title test: Add a test that the directory is not empty when create project chore: Add a test covering initializing a project in a non-empty directory Mar 24, 2024
@aklinker1 aklinker1 changed the title chore: Add a test covering initializing a project in a non-empty directory chore: Add a test covering wxt init in a non-empty directory Mar 24, 2024
@aklinker1 aklinker1 merged commit 08f32aa into wxt-dev:main Mar 24, 2024
17 checks passed
@aklinker1
Copy link
Collaborator

Released in v0.17.8

@btea btea deleted the test/add-initialize-test branch March 24, 2024 23:34
@btea
Copy link
Contributor Author

btea commented Mar 24, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants