stalniy / bdd-lazy-var

Provides UI for testing frameworks such as mocha, jasmine and jest which allows to define lazy variables and subjects.
MIT License
162 stars 14 forks source link

Support of Jest? #23

Closed dezoxel closed 6 years ago

dezoxel commented 6 years ago

Hey Sergey,

We use React and create-react-app in our projects. Do you plan to support Jest?

Maybe you could point me in the direction of how to implement it by myself?

stalniy commented 6 years ago

Hi

I didn't plan to do that but PRs are very welcome :)

About implementation:

  1. you need to understand whether best allow to add additional UI like mocha.
  2. you need to understand how jest exposes currentTest and whether it creates prototype tree for nested tests
  3. You need to know how to access patent suite from currentTest
  4. Add implementation to https://github.com/stalniy/bdd-lazy-var/tree/master/lib/interface. check how it was done for mocha

Ps: sorry for the delayed reply

stalniy commented 6 years ago

I did some refactoring of the project so now it should be clearer what to do. Unfortunetely there are some mocha internals in lib/interface.js which should be moved in lib/interface/mocha.js and passed as a callback function

stalniy commented 6 years ago

as far as I can tell jest was written based on jasmine2 that means that we need to add support for jasmine2 and it should work as well for jest.

PS: if you run npm i jest you will find jest-jasmine2 module in your node_modules

stalniy commented 6 years ago

I finished with implementation for jasmine2 you can take a look at ede928c20038ba0228e08faeb9a6701d0e5415b8 and lib/interface/jasmine.js to understand how to do this for jest

stalniy commented 6 years ago

published 2.0 to npm

stalniy commented 6 years ago

added support for jest and published 2.1.1 to npm

dezoxel commented 6 years ago

Wow, awesome! We will try it soon and I'll give a feedback, thanks a lot!