Skip to content

test(e2e): add case for transpiling .svelte files#5273

Merged
chenjiahan merged 1 commit intomainfrom
svelte_transpile_e2e_0519
May 19, 2025
Merged

test(e2e): add case for transpiling .svelte files#5273
chenjiahan merged 1 commit intomainfrom
svelte_transpile_e2e_0519

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

Summary

Introduces a new E2E test case for transpiling .svelte files 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

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings May 19, 2025 06:30
@netlify
Copy link
Copy Markdown

netlify Bot commented May 19, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit 4b76384
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/682acffa31c9e800083e4607
😎 Deploy Preview https://deploy-preview-5273--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 85 (🔴 down 2 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 rsbuild with Svelte and syntax-check plugins
  • Adds a Playwright-based build test and a .browserslistrc targeting 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 $state helper 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 await the resolves expectation (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?.value will always be undefined since value isn’t attached to window. If the goal is to inspect the component’s value, log value directly or assign it to window explicitly.
    console.log('test optional chaining', window?.value);

@chenjiahan chenjiahan merged commit ae0c75b into main May 19, 2025
12 checks passed
@chenjiahan chenjiahan deleted the svelte_transpile_e2e_0519 branch May 19, 2025 06:39
This was referenced May 19, 2025
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.

2 participants