test: deduplicate code using functions (#214)
test: deduplicate code using functions (#214)

The purpose of this PR is to wrap duplicated code into functions.
This PR also fixes a bug in the testing of width tolerance increases.
Prior, we were testing that a 40% increase (`1.40`) was less than the
desired bound of `2.40`. Now, we add a small amount to the tolerance
upper bound (`0.004`) so that when we check increases that are slightly
more than 40% (e.g. 40.1%) we account for the rounding that occurs in
generating target widths.
imgix/imgix-core-js