Skip to content
Snippets Groups Projects
  1. Sep 25, 2023
    • Benjamin Franzke's avatar
      [TASK] Migrate JavaScript unit test from karma to @web/test-runner · 169c9253
      Benjamin Franzke authored
      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: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
      Tested-by: default avatarBenjamin Franzke <ben@bnf.dev>
      Reviewed-by: default avatarBenni Mack <benni@typo3.org>
      Reviewed-by: default avatarBenjamin Franzke <ben@bnf.dev>
      Tested-by: default avatarBenni Mack <benni@typo3.org>
      Tested-by: default avatarcore-ci <typo3@b13.com>
      Reviewed-by: default avatarAndreas Fernandez <a.fernandez@scripting-base.de>
      169c9253
  2. Sep 05, 2023
  3. Mar 09, 2023
    • Benjamin Kott's avatar
      [TASK] Cleanup eslint configuration · 03e4a4a5
      Benjamin Kott authored
      We renamed the eslint configuration to follow the recommended standards
      so developers IDEs will pick up the configuration more easily.
      
      The ruleset was adapted to follow a wider range of recommendations.
      - eslint:recommended
      - @typescript-eslint/recommended
      - lit/recommended
      - wc/recommended
      
      In addition we now also force more kinds of spacing rules to avoid
      IDEs having different opinions on how to format for example includes.
      
      The only recommendation we don't want to follow is
      - @typescript-eslint/no-inferrable-types.
      We don't want to disallow being explicit.
      
      Instead of turning off rules we cannot fully fulfill as of now, we are
      now changing the configuration to warning. This will help developers
      spotting mistakes more easy when writing code.
      
      Rules that are currently in "warn" mode:
      - @typescript-eslint/ban-types
      - @typescript-eslint/no-explicit-any
      - @typescript-eslint/no-this-alias
      
      To only check for errors run in the Build directory:
      - npx eslint ./Sources/TypeScr...
      03e4a4a5
  4. Sep 06, 2022
  5. Apr 05, 2022
  6. Jul 29, 2021
  7. Dec 15, 2020
  8. Jan 07, 2020
  9. May 10, 2019
  10. Apr 23, 2019
  11. Jul 30, 2018
  12. May 11, 2018
  13. Nov 03, 2017
  14. Oct 30, 2017
  15. May 17, 2017
  16. Mar 28, 2017
  17. Mar 26, 2017
  18. Feb 01, 2017
  19. Nov 26, 2015
  20. Oct 08, 2015
  21. Apr 06, 2015
  22. Nov 24, 2014
  23. Nov 16, 2014
  24. Sep 16, 2014