typescript-expect-plugin icon indicating copy to clipboard operation
typescript-expect-plugin copied to clipboard

Is there a way to run the tests on command?

Open albizures opened this issue 5 years ago • 5 comments

So it can be added as another npm script

albizures avatar May 30 '20 17:05 albizures

In future it might work during tsc build but currently TypeScript compiler doesn't support plugins. Related issues:

  • https://github.com/microsoft/TypeScript/issues/38736
  • https://github.com/microsoft/TypeScript/issues/16607

This plugin is currently only for editor experience.

I have tested this with Next.js and Create React App. In both frameworks plugin work in editor but not in terminal.

I'll investigate this further but probably there's nothing I can do. It would be super cool to have tests run during build time.

Idered avatar May 31 '20 11:05 Idered

@albizures I could recreate this as eslint plugin - it would allow to run tests by running eslint command

Idered avatar May 31 '20 13:05 Idered

Wow, that's super cool! is this already public? so I can test it 🤗

By the way thanks for you work in this module 🙏

albizures avatar May 31 '20 20:05 albizures

@albizures nope, eslint version is not available yet

Idered avatar Jun 01 '20 11:06 Idered

oh sorry, until now I noticed I misread you comment, and I thought it was a work in progress already.

And just as a random thought, is this something that could be done using a jest transformer alongside babel?

albizures avatar Jun 01 '20 18:06 albizures