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

test: cleanup testConfig.baseRoute and use testConfig.previewBase #14475

Merged

Conversation

sapphi-red
Copy link
Member

Description

  1. Remove testConfig.baseRoute as it was not used
  2. Fix relative-base test to run the preview server with a different base
    • testConfig.baseRoute was introduced to do this. So I restored that by changing the base when running preview.

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@sapphi-red sapphi-red added p1-chore Doesn't change code behavior (priority) test labels Sep 26, 2023
@stackblitz
Copy link

stackblitz bot commented Sep 26, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

I think I'm somewhat leaning to the approach we have before, maybe renaming as testConfig.previewBase would make more sense? The custom plugin to set the base only for preview is a bit complex to setup.

@sapphi-red
Copy link
Member Author

There was a problem with the previous testConfig.baseRoute that it didn't handle pnpm run preview.
This was the reason I wrote this way but I can add it later when #12298 is merged if it's better.

@bluwy
Copy link
Member

bluwy commented Sep 28, 2023

Yeah if #12298 is merged first to simplify the changes, then I'd be fine with it 👍

@sapphi-red sapphi-red changed the title test: remove unused testConfig.baseRoute test: cleanup testConfig.baseRoute and use testConfig.previewBase Sep 30, 2023
@sapphi-red
Copy link
Member Author

Renamed to previewBase and made it test-only.

Comment on lines -32 to -34
testConfig: {
baseRoute: '/url-base/',
},
Copy link
Member Author

Choose a reason for hiding this comment

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

This file is not using relative path, so this can be removed.

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks for making the changes

@sapphi-red sapphi-red merged commit bf3cc83 into vitejs:main Oct 3, 2023
9 of 10 checks passed
@sapphi-red sapphi-red deleted the test/refactor-testconfig-baseroute branch October 3, 2023 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p1-chore Doesn't change code behavior (priority) test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants