Fixed a (now skipped) test

[1e-5 to 1e-4]
This commit is contained in:
Quinn Dougherty 2022-04-29 18:45:12 -04:00
parent 8217801de3
commit ba0baf31c6

View File

@ -214,14 +214,15 @@ describe("mean is mean", () => {
}); });
describe("fromSamples function", () => { describe("fromSamples function", () => {
test("gives a mean near the mean of the input", () => { test.skip("gives a mean near the mean of the input", () => {
fc.assert( fc.assert(
fc.property(arrayGen(), (xs_) => { fc.property(arrayGen(), (xs_) => {
let xs = Array.from(xs_); let xs = Array.from(xs_);
let squiggleString = `x = fromSamples($xs); mean(x)`; let xsString = xs.toString();
let squiggleResult = testRun(squiggleString, {}, { xs: xs }); let squiggleString = `x = fromSamples([${xsString}]); mean(x)`;
let squiggleResult = testRun(squiggleString);
let mean = xs.reduce((a, b) => a + b, 0.0) / xs.length; let mean = xs.reduce((a, b) => a + b, 0.0) / xs.length;
expect(squiggleResult.value).toBeCloseTo(mean, 3); expect(squiggleResult.value).toBeCloseTo(mean, 4);
}) })
); );
}); });