test(e2e): add case for transpiling .svelte files#5273
Merged
chenjiahan merged 1 commit intomainfrom May 19, 2025
Merged
Conversation
✅ Deploy Preview for rsbuild ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds a new end-to-end test case to verify that .svelte files are correctly transpiled to ES2015.
- Introduces a minimal Svelte app (
App.svelte+index.js) - Configures
rsbuildwith Svelte and syntax-check plugins - Adds a Playwright-based build test and a
.browserslistrctargeting Chrome 53
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| e2e/cases/svelte/transpile/src/index.js | Mounts the Svelte App component |
| e2e/cases/svelte/transpile/src/App.svelte | Defines the main component with state and a button |
| e2e/cases/svelte/transpile/rsbuild.config.ts | Configures @rsbuild with Svelte and syntax plugins |
| e2e/cases/svelte/transpile/index.test.ts | Adds a test to assert the build succeeds |
| e2e/cases/svelte/transpile/.browserslistrc | Sets the browser target for transpilation |
Comments suppressed due to low confidence (3)
e2e/cases/svelte/transpile/src/App.svelte:7
- The
$statehelper isn’t imported, which will cause a ReferenceError. Add the appropriate import (for example,import { state as $state } from 'svelte';) so the component compiles.
let value = $state('Hello World');
e2e/cases/svelte/transpile/index.test.ts:11
- You need to
awaittheresolvesexpectation (e.g.,await expect(...).resolves.toBeTruthy()) to ensure the test runner waits for the build promise.
).resolves.toBeTruthy();
e2e/cases/svelte/transpile/src/App.svelte:11
- [nitpick] Logging
window?.valuewill always beundefinedsincevalueisn’t attached towindow. If the goal is to inspect the component’svalue, logvaluedirectly or assign it towindowexplicitly.
console.log('test optional chaining', window?.value);
This was referenced May 19, 2025
Merged
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.

Summary
Introduces a new E2E test case for transpiling
.sveltefiles to ES2015. The changes include adding a Svelte application, configuring the build system, and writing a test to validate the transpilation process.Related Links
Checklist