test: replace content hashes and full hashes to placeholders in css extract plugin cases#9398
Merged
LingyuCoder merged 1 commit intomainfrom Feb 20, 2025
Merged
Conversation
…xtract plugin cases
✅ Deploy Preview for rspack canceled.
|
LingyuCoder
commented
Feb 20, 2025
tests/plugin-test/css-extract/cases/es-named-export-as-is-output-module/expected/main.css
Show resolved
Hide resolved
CodSpeed Performance ReportMerging #9398 will not alter performanceComparing Summary
|
JSerFeng
approved these changes
Feb 20, 2025
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
don't want to flush hashes in plugin tests anymore
This pull request includes multiple changes to the
tests/plugin-test/css-extract/TestCases.test.jsfile and several other test files to improve the handling and comparison of hashes in test cases. The most important changes include the addition of functions to normalize paths and retrieve hashes, modifications to thecompareDirectoryfunction to handle hashes, and updates to expected test output files to use placeholders for hashes.Improvements to hash handling in tests:
tests/plugin-test/css-extract/TestCases.test.js: Added functionsnormalizePath,getHashes,recoveryHash, andremoveHashto handle and compare hashes in test cases. ModifiedcompareDirectoryto use these functions for comparing directories with hashes. [1] [2] [3]Updates to expected test output files:
tests/plugin-test/css-extract/cases/chunkFilename-fullhash/expected/main.js: Replaced hardcoded full hash with placeholder__FULL_HASH__.tests/plugin-test/css-extract/cases/es-named-export-as-is-output-module/expected/main.cssandmain.mjs: Updated class names to use new placeholders. [1] [2]tests/plugin-test/css-extract/cases/es-named-export-as-is/expected/main.cssandmain.js: Updated class names to use new placeholders. [1] [2]tests/plugin-test/css-extract/cases/hmr-locals/expected/main.cssandmain.js: Updated class names and full hash placeholders. [1] [2] [3]tests/plugin-test/css-extract/cases/hmr/expected/main.js: Updated full hash placeholder.tests/plugin-test/css-extract/cases/issue-6649/expected/main.js: Replaced hardcoded content hashes and full hash with placeholders. [1] [2]tests/plugin-test/css-extract/cases/js-hash/expected/style.$8f598b234f360ef39d24$.1.css: Removed redundant CSS rules.Changes to hash function and digest length:
tests/plugin-test/css-extract/TestCases.test.js: Changed hash function frommd4toxxhash64and updated hash digest length from 20 to 16. [1] [2]Checklist