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

shenanigans-manager: Add real-time TypeScript transpiles for tests #218

Open
JoshuaKGoldberg opened this issue Jul 12, 2020 · 0 comments
Open
Labels
area: tooling Builds, infrastructure, packages, and other repository management difficult This is a hard issue. You'll want to get a few smaller ones done before trying it. package: shenanigans-manager status: accepting prs Go ahead and send a pull request to resolve this issue!

Comments

@JoshuaKGoldberg
Copy link
Member

Right now, the testing infrastructure is annoyingly two-step:

  1. Source files and tests written in TypeScript must be transpiled to JavaScript
  2. Tests can then be run in-browser or on the CLI via mocha-headless-chrome

Ideally (1.) would be completely removed so that test files don't need to be transpiled before running. That'd make testing a bit easier to do:

  • No more yarn compile -w in order to prepare test files to run
  • CI builds could run tests in parallel with compile, instead of in series in the same task

There are three likely possible ways to improve this situation, in order of my preference:

  • Targeting more than JSDOM jestjs/jest#848: Jest could support running in a browser (Jest is my personal favorite test runner)
  • In theory, Mocha might be able to directly import and transform test files the way Jest does - though it's more complicated because of mocha-headless-chrome (ts-node is not the answer)
  • shenanigans-manager could switch to another test runner such as Karma

I would accept any of the above three things as a resolution to this issue - though switching to something like Karma is the most likely. It's acceptable to me that rewriting test assertions to a different library such as Jasmine would be required.

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Go ahead and send a pull request to resolve this issue! type: cleanup Improving code architecture and/or cleanliness. difficult This is a hard issue. You'll want to get a few smaller ones done before trying it. package: shenanigans-manager area: tooling Builds, infrastructure, packages, and other repository management and removed type: cleanup Improving code architecture and/or cleanliness. labels Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: tooling Builds, infrastructure, packages, and other repository management difficult This is a hard issue. You'll want to get a few smaller ones done before trying it. package: shenanigans-manager status: accepting prs Go ahead and send a pull request to resolve this issue!
Projects
None yet
Development

No branches or pull requests

1 participant