question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regression in v2.15.0

See original GitHub issue

🐛 Bug Report

I was trying to upgrade the fast-check version in one of my packages from v2.14.0 to the latest version, but my tests began to fail. I bisected the versions and it looks like the regression occurred in v2.15.0. I’ve also put together a small repro.

To Reproduce

Run the following:

import * as fc from 'fast-check'

fc.assert(
  fc.property(
    fc.tuple(
      fc.tuple(
        fc.func(fc.anything())
      )
    ).map(([x]) => x).map(([x]) => x),
    console.log
  )
)

The following error occurs:

file:///home/tomer/playground/node_modules/.pnpm/fast-check@2.18.0/node_modules/fast-check/lib/esm/check/arbitrary/definition/NextArbitrary.js:114
            Object.defineProperty(mappedValue, cloneMethod, { get: () => () => this.mapperWithCloneIfNeeded(v)[0] });
                   ^

TypeError: Cannot redefine property: Symbol(fast-check/cloneMethod)
    at Function.defineProperty (<anonymous>)
    at MapArbitrary.mapperWithCloneIfNeeded (file:///home/tomer/playground/node_modules/.pnpm/fast-check@2.18.0/node_modules/fast-check/lib/esm/check/arbitrary/definition/NextArbitrary.js:114:20)
    at MapArbitrary.valueMapper (file:///home/tomer/playground/node_modules/.pnpm/fast-check@2.18.0/node_modules/fast-check/lib/esm/check/arbitrary/definition/NextArbitrary.js:119:49)
    at MapArbitrary.generate (file:///home/tomer/playground/node_modules/.pnpm/fast-check@2.18.0/node_modules/fast-check/lib/esm/check/arbitrary/definition/NextArbitrary.js:84:21)
    at MapArbitrary.generate (file:///home/tomer/playground/node_modules/.pnpm/fast-check@2.18.0/node_modules/fast-check/lib/esm/check/arbitrary/definition/NextArbitrary.js:83:28)
    at file:///home/tomer/playground/node_modules/.pnpm/fast-check@2.18.0/node_modules/fast-check/lib/esm/arbitrary/_internals/TupleArbitrary.js:43:62
    at Array.map (<anonymous>)
    at TupleArbitrary.generate (file:///home/tomer/playground/node_modules/.pnpm/fast-check@2.18.0/node_modules/fast-check/lib/esm/arbitrary/_internals/TupleArbitrary.js:43:49)
    at Property.generate (file:///home/tomer/playground/node_modules/.pnpm/fast-check@2.18.0/node_modules/fast-check/lib/esm/check/property/Property.generic.js:22:55)
    at Object.value (file:///home/tomer/playground/node_modules/.pnpm/fast-check@2.18.0/node_modules/fast-check/lib/esm/check/runner/Tosser.js:6:28)

Expected behavior

It should run without throwing.

Your environment

Packages / Softwares Version(s)
fast-check v2.15.0
node v16.11.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
TomerAberbachcommented, Oct 23, 2021

Upgraded to v2.18.1 and can confirm my tests are passing 😄

1reaction
dubzzzcommented, Oct 23, 2021

Fix included and published in:

  • v2.15.1
  • v2.16.1
  • v2.17.1
  • v2.18.1
Read more comments on GitHub >

github_iconTop Results From Across the Web

color stream shown blank in realsense viewer exept for YUYV ...
Issue Description. I open realsense viewer and start color stream in RGB8, which results in a blank screen.
Read more >
How To Interpret R-squared in Regression Analysis
R-squared measures the strength of the relationship between your linear model and the dependent variables on a 0 - 100% scale. Learn about...
Read more >
Chapter 15 – Multiple Regression
Multiple regression is an extension of the linear regression already studied where we create a model to explain a response variable based on...
Read more >
15 Types of Regression in Data Science - ListenData
This article explains 15 types of regression techniques which are used for various data problems. It includes detailed theoretical and practical explanation ...
Read more >
Simple linear regression in Stata® - YouTube
Discover how to fit a simple linear regression model and graph the results using Stata. Copyright 2011-2019 StataCorp LLC.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found