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