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

How do I use Mocha with TSDX? #921

Closed
dgreene1 opened this issue Nov 3, 2020 · 4 comments
Closed

How do I use Mocha with TSDX? #921

dgreene1 opened this issue Nov 3, 2020 · 4 comments
Labels
kind: question This is a usage or similar question kind: support Asking for support with something or a specific use case solution: out-of-scope This is out of scope for this project solution: workaround available There is a workaround available for this issue

Comments

@dgreene1
Copy link

dgreene1 commented Nov 3, 2020

I'm putting this information here in case anyone else is looking to do this:

Solution:

  1. modify your package.json to use the example provided here
  2. following the instructions here so you can ignore the Jest types
@dgreene1
Copy link
Author

dgreene1 commented Nov 3, 2020

Self-answered

@dgreene1 dgreene1 closed this as completed Nov 3, 2020
@agilgur5 agilgur5 added kind: question This is a usage or similar question kind: support Asking for support with something or a specific use case solution: out-of-scope This is out of scope for this project solution: workaround available There is a workaround available for this issue labels Nov 3, 2020
@agilgur5
Copy link
Collaborator

agilgur5 commented Nov 3, 2020

You can also use --require ts-node/register, though it is slower than just compiling then running tests.

@dgreene1
Copy link
Author

dgreene1 commented Nov 3, 2020

Thanks, yes. The main reason I made this post is to share that you have to resort to some unique hacks to get the Jest types out of the way. I describe that more in detail in the second link I placed above.

@agilgur5
Copy link
Collaborator

agilgur5 commented Nov 3, 2020

Yea that's suboptimal experience. I've been looking to split up the commands for a while now (e.g. #407 is an initial step toward that) so that if you wanted to, instead of installing tsdx, you install @tsdx/rollup and @tsdx/eslint but not @tsdx/jest in this case. That would also open it up for a @tsdx/mocha for instance too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: question This is a usage or similar question kind: support Asking for support with something or a specific use case solution: out-of-scope This is out of scope for this project solution: workaround available There is a workaround available for this issue
Projects
None yet
Development

No branches or pull requests

2 participants