MCPcopy
hub / github.com/fabricjs/fabric.js / testFractionDigits

Function testFractionDigits

test/unit/object.js:214–225  ·  view source on GitHub ↗
(fractionDigits, expectedValue)

Source from the content-addressed store, hash-verified

212 fractionDigitsDefault = 2;
213
214 function testFractionDigits(fractionDigits, expectedValue) {
215
216 fabric.config.configure({ NUM_FRACTION_DIGITS: fractionDigits });
217
218 testedProperties.forEach(function(property) {
219 cObj.set(property, fractionalValue);
220 assert.equal(cObj.toObject()[property], expectedValue,
221 'value of ' + property + ' should have ' + fractionDigits + ' fractional digits');
222 }, this);
223
224 fabric.config.configure({ NUM_FRACTION_DIGITS: fractionDigitsDefault });
225 }
226
227 testFractionDigits.call(this, 2, 166.67);
228 testFractionDigits.call(this, 3, 166.667);

Callers

nothing calls this directly

Calls 3

configureMethod · 0.80
setMethod · 0.45
toObjectMethod · 0.45

Tested by

no test coverage detected