Repository navigation
Delete dead jest harness and move specs - #272
Open
Dumea Alexandru (alexdumea) wants to merge 5 commits into
Open
Dumea Alexandru (alexdumea) wants to merge 5 commits into
Dumea Alexandru (alexdumea) wants to merge 5 commits into
Conversation
Dumea Alexandru (alexdumea)
requested review from
Björn Meyer (BrocksiNet) and
Dominik Grothaus (dgrothaus-sw)
and removed request for
Dominik Grothaus (dgrothaus-sw)
October 7, 2026 11:47
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.
1. Why is this change necessary?
The Administration Jest specs lived in two places that both broke Shopware's test-structure ADR (
adr/2022-10-20-test-structure.md), which puts each spec next to the code it tests:src/Resources/app/administration/test/andtests/jest/administration/.lint:admindoesn't coveradministration/test/, so 14 of the 17 specs were never linted.A second Jest setup under
src/Resources/app/administration/(jest.config.js,babel.config.js,package.json,package-lock.json) was unused as a test harness.The release zip also shipped test scaffolding: the 14 specs in
administration/test/, the dead Jest setup and the test-only PHP helpers insrc/Ucp/Test. Those helpers are already kept out of production byservices.phpandroutes.php, but they shouldn't ship at all.2. What does this change do, exactly?
Removes the unused Jest setup.
jest.config.js,babel.config.jsandpackage-lock.jsonare deleted; nothing referenced them. The live config attests/jest/administration/jest.config.jshas its own@swc/jesttransform, and the admin source imports no npm packages.Replaces the admin
package.jsonwith a minimal one ({"private": true}), dropping the old Jest scripts and dependencies. The file has to stay: it is the nearestpackage.jsonabove the admin source, and without it the plugin root's"type": "module"applies there. Webpack 5 (the 6.6 webpack build) then treats the admin.jsfiles as strict ESM and fails on extensionless imports such as./core-feature. Apackage.jsonwithout"type"keeps normal resolution, like core's adminpackage.json. Webpack 4 (6.5) and Vite (6.6 vite, trunk) don't apply this rule.Moves all 17 specs next to the code they test, under
src/Resources/app/administration/src/, named the way core names them:<component>.spec.jsfor a component's main spec;<component>-<aspect>.spec.jsfor extra specs on the same component, like core'ssw-sales-channel-detail-tabs.spec.js;<file>.spec.jsnext to plain modules.Only relative paths changed. The
eslint-disablecomments for rules that aren't configured (import/first,global-require) were removed.Reduces Jest's
testMatchto one glob,src/Resources/app/administration/src/**/*.spec.js. The specs now fall under the existinglint:adminscope, soeslint.config.mjsis unchanged andjest/no-disabled-testsstays atwarn.Keeps test scaffolding out of the zip (
.shopware-extension.yml):src/Ucp/Testis added topack.excludes.paths.pack.before_hooksstep, becauseexcludes.pathsonly takes literal paths, not globs. The hook runs in the temporary build copy ($EXTENSION_DIR) before the checksums and the zip are written, so production files next to the specs still ship.Guards the test-only PHP helpers, so a non-prod shop installed from the zip still boots without
src/Ucp/Test. Before,services.php,routes.phpandTestAgentProfileFetcherCompilerPassloaded those classes wheneverAPP_ENVwasn'tprod. They now also checkclass_exists()/is_dir().Fails the build if test scaffolding comes back.
bin/ci-assert-zip-no-vendor.sh, whichpackage-zip.ymlalready runs, now fails when the zip contains any*.spec.jsor anything undersrc/Ucp/Test/. The spec removal depends on ashopware-clihook, so this catches a future CLI change that silently stops running it.