Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for running manual and automated tests written in TS. #886

Merged
merged 4 commits into from
Jun 1, 2023

Conversation

martnpaneq
Copy link
Contributor

@martnpaneq martnpaneq commented May 26, 2023

Suggested merge commit message (convention)

Other (tests): Support for running manual and automated tests written in TypeScript. Remember that test runners do not validate types as we use esbuild which ignores it. Closes ckeditor/ckeditor5#14170, ckeditor/ckeditor5#14171.


Additional information

For example – encountered issues, assumptions you had to make, other affected tickets, etc.

@martnpaneq martnpaneq changed the title Added support for running manual tests written in TS. Added support for running manual and automated tests written in TS. May 29, 2023
Copy link
Contributor

@psmyrek psmyrek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manual and automated tests in TypeScript work fine 🎉

Remarks:

  1. I found that the build directory for manual tests contains .ts files, which are not needed there (they are not imported by .html files):

    Would it be possible to not copy TypeScript files?

  2. In lib/tasks/runautomatedtests.js there is IGNORE_GLOBS that also should skip TypeScript files.

  3. I think that a few sentences in the CKE5 docs (contributing section) about the fact that manual and automated tests can be written now in both JavaScript and TypeScript would be useful.

@martnpaneq
Copy link
Contributor Author

Manual and automated tests in TypeScript work fine 🎉

Remarks:

  1. I found that the build directory for manual tests contains .ts files, which are not needed there (they are not imported by .html files):

    Would it be possible to not copy TypeScript files?
  2. In lib/tasks/runautomatedtests.js there is IGNORE_GLOBS that also should skip TypeScript files.
  3. I think that a few sentences in the CKE5 docs (contributing section) about the fact that manual and automated tests can be written now in both JavaScript and TypeScript would be useful.

@psmyrek

  1. Fixed.
  2. Good catch. I did not test running all tests and without this change the tests would fail.
  3. I added a PR for ckeditor5 with some info about TS support in the testing-environment section. I'm not sure if it's the best place, so if you have a better idea please let me know Added docs for TS support for automated and manual tests. ckeditor5#14285

Copy link
Contributor

@psmyrek psmyrek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

Copy link
Member

@pomek pomek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

It works as expected, tests are compiled, but we lost type checking due to esbuild. It's fine when prototyping things, tho. I feel that at some point, we will bring back ts-loader behind some flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for running manual tests written in TS
3 participants