plotly / plotly.js

Open-source JavaScript charting library behind Plotly and Dash
https://plotly.com/javascript/
MIT License
16.81k stars 1.85k forks source link

Discussion on jasmine test organization and abstractions #529

Closed etpinard closed 6 years ago

etpinard commented 8 years ago

@mdtusz @mdtusz

Our jasmine test suites are grown a lot in the past few months. We should spend some time discussing ways to make writing jasmine tests easier.

mdtusz commented 8 years ago

I find the biggest drain in writing tests to be the boilerplate and ensuring that there's no leaks or side affects from test to test - often I'll find myself debugging tests that pass individually but not when run together. I'm not sure the best way to go about improving this, or if we really can do much other than improving upon the "standard" way of setting up/tearing down each test.

Perhaps if we take some time to look through existing tests and seek out the most commonly recurring patterns, and create a small stdTestLib including the things we always use (create/destroy the gd followed by Plotly.plot(...).then(...), etc.)?

monfera commented 8 years ago

Here's an attempt that we decided not to use for now, and it would benefit from lots of constructive criticism even if we were to use test utilities that are heavier than createGraphDiv etc.:

Use: gl_plot_interact_basic_test

Backstage:

Notes, so as we remember considerations that went into it:

The docs in the source code overlap with the above. Also, as it's a first iteration, there may be shortcomings relative to the above aims, despite having tested tests, and there may be technical weaknesses besides the issue that it's a much heavier abstraction than createGraphDiv.

etpinard commented 6 years ago

Just noticed this ticket again.

This ticket never turned into a serious discussion that could possible lead to changes in our test suites.

Closing.