Skip to content
Piotrek Koszuliński edited this page Apr 20, 2018 · 4 revisions


⚠⚠ ⚠⚠ ⚠⚠

This wiki served in the early days of CKEditor 5 development and can be severely outdated.

Refer to the official CKEditor 5 documentation for up-to-date information.






Testing in CKEditor 5 is based on Bender.js.

These are some of our goals:

  • Code merged into the main development branches (e.g. master) must have tests.
  • 100% code coverage for the editor (including branches) and ideally above 80% code coverage for development tasks.
  • Reduce the time spent on manual tests to the very minimum. This is achieved either by automation or by proper use of Bender’s manual tests feature.

Libraries Used for Testing

Test Directories and Files

When it comes to tests, the following is an example of directories and files that should be present in all projects:

ckeditor5-<something>/
  src/  -> Main source code.
  tests/  -> Test files.

However, most packages will not be able to run their tests by themselves due to the building process being centralized in the main CKEditor 5 development repository. Therefore, testing must be performed by installing a concrete package as a ckeditor5 dependency (see Development Workflow) and running tests from there.

The ckeditor5 repository has the following structure for tests:

ckeditor5/
  src/  -> Main source code.
  tests/  -> Test files.
  bender.js  -> Bender.js configuration file.
  package.json  -> Having a devDependency to Bender.js.

The building process moves all source and test files from the main repo and all installed dependencies to the dist/ directory. Bender.js then reads all test files from there, what means that after changing any file, the editor must be rebuilt. This can be done automatically by running the builder in the watch mode:

gulp build --watch
Clone this wiki locally