test: test server.origin#17886
Merged
Merged
Conversation
|
|
hi-ogawa
commented
Aug 15, 2024
Comment on lines
-30
to
-34
| server: { | ||
| // This option caused issues with HMR, | ||
| // although it should not affect the build | ||
| origin: 'http://localhost:8080', | ||
| }, |
Contributor
Author
There was a problem hiding this comment.
Technically this is testing server.origin, but this relies on rather redundant prepend/strip base manipulation, which is going to removed in #17886.
bluwy
reviewed
Aug 15, 2024
bluwy
reviewed
Aug 16, 2024
Comment on lines
+27
to
+31
| await vi.waitFor(() => | ||
| page | ||
| .locator('.asset-reference.outside-root .asset-preview') | ||
| .evaluate((el: HTMLImageElement) => el.naturalWidth > 0), | ||
| ) |
Member
There was a problem hiding this comment.
Shouldn't this use expect so that it throws if the image is not shown yet? Not familiar with waitFor, but I thought it would retry only when it throws
Contributor
Author
There was a problem hiding this comment.
Oh, good catch. I meant to use waitUntil https://vitest.dev/api/vi.html#vi-waituntil
bluwy
previously approved these changes
Aug 16, 2024
sapphi-red
reviewed
Aug 20, 2024
sapphi-red
approved these changes
Aug 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a test case for
server.origin(introduced long time ago in #5104). The playground here doesn't actually have a separate server, so it doesn't really make sense, but this confirms that url asset is served withserver.originprefix as intended.I also made a PR on sapphi-red/vite-setup-catalogue#39 to update an example to show case the actual usage with backend.