Repository navigation
fix(webapps): restore frontend test harnesses - #3900
hauptmedia wants to merge 2 commits into
Conversation
|
Can you track where this config got lost and how the error was introduced? |
|
@javahippie I traced this through the Git history and added the findings, including the introducing commits and upstream PR links, to the Root cause and history section of the PR description. The missing root Karma config originates from the 2023 Webpack migration: it introduced the reference without adding the file. The SDK mock fixture was deleted separately in 2021 despite still being imported by tests. The description also explains why the current Maven/Neo checks do not catch these legacy test-harness failures. |
|
Thanks! Is it possible to remove the pure formatting changes from the PR and only keep the lines that fix the issue? |
|



Summary
The legacy frontend's advertised
npm testcommand fails becausekarma.config.jsis missing. The SDK Node tests also cannot start because their REST mock fixture and test dependencies are missing.Add the missing Webpack-compatible Karma UI configuration and restore the SDK mock fixture, pin the required development dependencies, and expose separate
test:sdkandtest:uicommands.npm testruns both in sequence. Update three Superagent header assertions and two Sinon reset calls for the current libraries, preserving their expected behavior.This PR covers the test-harness problem extracted from #3820. The SDK calendar validation and Neo XML resolver are separate PRs. It is not a prerequisite for #3818.
Root cause and history
These gaps were inherited from upstream Camunda and have separate origins:
443141eb00, introduced"test": "karma start karma.config.js", but did not addwebapps/frontend/karma.config.js. The migration deleted the old Grunt task wiring. The existingui/common/unit-tests/karma.conf.jswas retained unchanged and still used Browserify, while its test adapters, reporters and dependencies were removed. Thus the root config was never committed, rather than deleted later; pointing the script at the old config alone would not restore the tests.0aa166c85e, deletedwebapps/camunda-bpm-sdk-js/test/superagent-mock-config.jsas an unused file. It was the commit's only changed file, with no replacement, althoughcoreSpec.jsstill required it. The fixture in this PR is byte-for-byte identical to the file before that deletion (Git blobf54c76892eda5547493d14cbceff3538e84347e1).f1d454db33, committed 3 August 2020, removed the SDK's own package manifest and its test dependency declarations. The 2023 Webpack migration then removed the SDK Grunt tasks and remaining shared Mocha/Chai/Sinon/Karma test dependencies. The SDK README continued advertising the removed Grunt commands.Why the current checks can remain green: the Webpack migration's Maven integration ran dependency installation, license checks and the production build, without
npm test. The current legacy Maven configuration still does so. The PR workflow's separate frontend test job runs inwebapps-neo/frontend, not the legacy frontend. Green Maven/Neo checks therefore do not validate the legacy Karma or SDK commands; the browser-validation limitation below still applies.The history was checked directly against the commits' Git trees, the introducing/deleting diffs, surviving test imports, and the restored fixture's blob hash.
Attribution
superagent-mock-config.jsis restored verbatim from commit ee7bbef8d02f85d0d6a7d4052b275d6b5b4cd18d, where it lived atwebapps/camunda-bpm-sdk-js/test/superagent-mock-config.js. Its original Camunda Apache-2.0 copyright and license header are retained.Validation
git diff --checkpass.