fusionjs / fusion-test-utils

Migrated to https://github.com/fusionjs/fusionjs
MIT License
5 stars 17 forks source link

Reduce API opaque-ness and embrace Jest #189

Open schnerd opened 5 years ago

schnerd commented 5 years ago

The fusion test environment heavily leverages Jest, which is great. However it does so in a way which is opaque to developers and leads to confusion.

Most developers know that fusion is using Jest internally. So they end up using other useful Jest globals like describe(), beforeAll() etc.

It's possible that some of these decisions may have been made in the spirit of trying to keep the Jest dependency hidden in case we want to switch to something else in the future. But I think this ship has sailed considering engineers are already leveraging other jest globals like describe/beforeEach/etc, and mockFunction just returns a jest.fn anyway with all it associated behavior in tact.

In the spirit of turning this into a more concrete request, I'm hoping we can:

sravanti commented 5 years ago

+1 for using Jest's test and expect — in the documentation, the use of assert and expect are inconsistent, which can be confusing to newcomers. Also agreed with linking out to Jest docs, as I didn't really understand that I should be referencing Jest docs in addition to the Fusion test util docs.

manassra commented 5 years ago

+1000! I can't stress about how many times I came across this problem when writing tests.

mlmorg commented 5 years ago

Sorry for the delay on responding to this on Github. We plan to remove the wrapper and expose Jest directly. We hope to tackle this in the next month or so.