Skip to content

test: compare CSS declarations regardless of order - #760

Merged
alexander-akait merged 1 commit into
mainfrom
test/css-declaration-order
Oct 18, 2026
Merged

alexander-akait merged 1 commit into
mainfrom
test/css-declaration-order

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

Summary

webpack 5.112.0 (Oct 15) changed the order its CSS minimizer emits declarations in: .a{color:red;background:url(…)} instead of .a{background:url(…);color:red}. Two tests in test/embedded-source.test.js compared the minified stylesheet verbatim, so they now fail.

Only the Node 10/12/14 rows hit it. Their npm can't read the v3 lockfile and installs webpack@latest. The other rows stay on the locked 5.109.2, where this file is skipped (it needs webpack ≥ 5.110). main is affected the same way; it shows up on every PR, e.g. #756.

Change

The two tests check that the data: payload inside the stylesheet is (or isn't) minified, not the declaration order. They now compare the stylesheet with its declarations sorted.

Tests

test/embedded-source.test.js passes against webpack 5.111.1 and 5.112.0 (20/20 on each). Lint, Prettier and cspell pass.


Generated by Claude Code

Summary by CodeRabbit

  • Tests
    • Updated stylesheet checks to accept equivalent declaration ordering, reducing sensitivity to formatting differences without changing expected behavior.

webpack 5.112's CSS minimizer emits declarations in a different order, so
the two embedded-source tests that compared the stylesheet verbatim failed
on the rows that install webpack@latest (Node 10/12/14).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QYPkbvwyRWt2SHgXDoYRdo
@changeset-bot

changeset-bot Bot commented Oct 18, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 072fc1c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.67%. Comparing base (f185baa) to head (072fc1c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #760   +/-   ##
=======================================
  Coverage   97.67%   97.67%           
=======================================
  Files           5        5           
  Lines        1718     1718           
  Branches      664      664           
=======================================
  Hits         1678     1678           
  Misses         39       39           
  Partials        1        1           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1821a1c9-1552-405b-be68-58eebf89317b
📥 Commits

Reviewing files that changed from the base of the PR and between f185baa and 072fc1c.

📒 Files selected for processing: 1
  • test/embedded-source.test.js

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Walkthrough

The test file adds a helper that sorts semicolon-separated declarations in a single-rule stylesheet while preserving its selector. Two nested-payload tests use the helper to sort actual and expected CSS before comparing them.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 072fc

The change lets the embedded-CSS tests tolerate order variation between distinct declarations. The fixture has no order-sensitive declarations, so no material merge risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main change: updating tests to compare CSS declarations regardless of order.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

test/embedded-source.test.js

Oops! Something went wrong! :(

ESLint: 10.13.0

Error: Error while loading rule 'jest/no-deprecated-functions': Unable to detect Jest version - please ensure jest package is installed, or otherwise set version explicitly
Occurred while linting /test/embedded-source.test.js
at detectJestVersion (/.eslint-tmp/node_modules/eslint-plugin-jest/lib/rules/utils/detectJestVersion.js:22:9)
at create (/.eslint-tmp/node_modules/eslint-plugin-jest/lib/rules/no-deprecated-functions.js:31:107)
at Object.create (/.eslint-tmp/node_modules/@typescript-eslint/utils/dist/eslint-utils/RuleCreator.js:39:20)
at createRuleListeners (/.eslint-tmp/node_modules/eslint/lib/linter/linter.js:502:15)
at /.eslint-tmp/node_modules/eslint/lib/linter/linter.js:628:7
at Array.forEach ()
at runRules (/.eslint-tmp/node_modules/eslint/lib/linter/linter.js:562:31)
at #flatVerifyWithoutProcessors (/.eslint-tmp/node_modules/eslint/lib/linter/linter.js:1297:4)
at Linter._verifyWithFlatConfigArrayAndWithoutProcessors (/.eslint-tmp/node_modules/eslint/lib/linter/linter.js:1382:43)
at Linter._verifyWithFlatConfigArray (/.eslint-tmp/node_modules/eslint/lib/linter/linter.js:1449:15)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@alexander-akait
alexander-akait merged commit 35c08c1 into main Oct 18, 2026
31 checks passed
@alexander-akait
alexander-akait deleted the test/css-declaration-order branch October 18, 2026 15:04
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.

1 participant