Infusion Builder's javascript unit tests are poorly factored, making them hard to debug and difficult to read
Description
The Infusion Builder's unit tests have been designed in an awkward way, causing state to be deeply coupled to all portions of the test. This makes the tests hard to read and understand, and gives them a monolithic structure that can be difficult to work with. Because we've factored the test functions themselves out into "creator functions," it's also very difficult to debug a particular instance of a test run correctly.
While it's tempting to just rewrite the tests from scratch, my suggestion is to start splitting pieces of the tests out into simpler chunks with less dependence on closure-derived state. With time, we can break out the tests into a few different files to ensure that they're correctly modularized.
Environment
None
Activity
Show:
Justin Obara March 3, 2014 at 4:20 PM
builder.fluidproject.org has been taken down and there are no immediate plans to replace it. Currently all builds are expected to be generated directly from the grunt build scripts.
The Infusion Builder's unit tests have been designed in an awkward way, causing state to be deeply coupled to all portions of the test. This makes the tests hard to read and understand, and gives them a monolithic structure that can be difficult to work with. Because we've factored the test functions themselves out into "creator functions," it's also very difficult to debug a particular instance of a test run correctly.
While it's tempting to just rewrite the tests from scratch, my suggestion is to start splitting pieces of the tests out into simpler chunks with less dependence on closure-derived state. With time, we can break out the tests into a few different files to ensure that they're correctly modularized.