Conversation
- Created shared-fixture.js utility to cache fixtures and servers across test files - Fixtures are loaded once and reused, but only built when explicitly requested - Dev servers and preview servers are shared across test files - Migrated astro-basic and ssr-script tests to new system - Split tests into focused files that share fixtures: - static-basic.test.js - Basic HTML and markdown tests - static-spread.test.js - Spread attribute tests - ssr-inline-scripts.test.js - SSR inline script tests - Renamed fixtures to simpler names: static/ and ssr/ - Tests can still run individually with 'node path/to/test.js' for development
|
- Remove unused exports from shared-fixture.js - Fix ESLint variable shadowing issues in ssr.test.js - Remove unused test-prerenderer.js file
- Remove unused previewServer and devServer variables - Shared servers are managed internally by the shared-fixture module
- Update config-server.test.js to use 'static' fixture - Update config-mode.test.js to use 'static' fixture - Update astro-sync.test.js to use 'static' fixture - These tests were still pointing to the old 'astro-basic' fixture
- Remove assetsInlineLimit config that was forcing inline scripts to be external - Remove external script tests that were incompatible with shared fixtures - Clean up SSR test structure since only inline script tests remain - Update shared fixture documentation to clarify limitations - Remove unused external script fixture files The original 'external scripts' tests were actually testing inline scripts with different build configurations, which isn't supported with shared fixtures that require identical configs across all tests.
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
This PR implements a shared fixture test system to significantly reduce test execution time by allowing multiple test files to share the same fixture builds and server instances.
Changes
New Shared Fixture System
shared-fixture.jsutility that provides:build())Test Migration
astro-basic.test.js→ split into:static-basic.test.js- Basic HTML, markdown, and page featuresstatic-spread.test.js- Spread attributes and scoped styles testsssr-script.test.js→ split into:ssr-inline-scripts.test.js- Inline script handling in SSRFixture Reorganization
astro-basic/→static/ssr-script/→ssr/Tests can be run in multiple ways:
Notes
This is the foundation for a larger effort to consolidate and optimize the test suite. More test files can be migrated to this pattern to further reduce test execution time.