-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] Migrate JavaScript unit test from karma to @web/test-runner
The karma unit testing framework has been deprecated and suggests to use modern alternatives instead. We use one of the recommended alternatives named @web/test-runner which is toolset by the modern-web.dev and open-wc.org initiatives. It is based on mocha and es-dev-server, which allows to run our JavaScript modules natively in the browser (without having to bundle them via rollup). Note that compiled test files have been removed from the source tree, since we configure es-dev-server to transpile them on demand, allowing error output from tests to be using original line numbers and unmangled identifiers. The tests are executed in chrome by default (locally and CI). They can be executed via: # Run once npm run test # Run tests whenever files change npm run watch:build npm run watch:test # Open browser with devtools and debug mode activated MODE=dev npm run watch:test -- --debug Configuration is prepared to run in other browsers via playwright. Example: # https://playwright.dev/docs/browsers#install-system-dependencies npx playwright install --with-deps BROWSERS=chrome,chromium,firefox,webkit npm run test Commands executed: npm remove \ karma \ karma-chrome-launcher \ karma-coverage \ karma-jasmine \ karma-junit-reporter \ karma-rollup-preprocessor \ jasmine-core \ @types/jasmine npm install --save-dev \ @web/test-runner \ @web/test-runner-playwright \ @web/dev-server-import-maps \ @web/dev-server-esbuild \ @open-wc/testing \ sinon git rm -rf \ typo3/sysext/core/Tests/JavaScript \ typo3/sysext/backend/Tests/JavaScript npm run build Resolves: #101960 Releases: main, 12.4 Change-Id: Ia2fa94a9f6d66664d9fce72e7443aaeb12e0ca08 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81040 Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de> Tested-by: Benjamin Franzke <ben@bnf.dev> Reviewed-by: Benni Mack <benni@typo3.org> Reviewed-by: Benjamin Franzke <ben@bnf.dev> Tested-by: Benni Mack <benni@typo3.org> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
- Loading branch information
Showing
49 changed files
with
3,070 additions
and
1,604 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.