Repository: dubzzz/fast-check
Pull request #2034 (2021-06-24 21:59:41)

🚚 Move `sparseArray` arbitrary into /arbitrary
<!-- Context of the PR: short description and potentially linked issues -->

<!-- ...a few words to describe the content of this PR...               -->
<!-- ... -->

<!-- Type of PR: [ ] unchecked / [ ] checked -->
**_Category:_**

- [ ] ✨ Introduce new features
- [ ] 📝 Add or update documentation
- [ ] ✅ Add or update tests
- [ ] 🐛 Fix a bug
- [ ] 🏷️ Add or update types
- [ ] ⚡️ Improve performance
- [x] _Other(s):_ Move code
<!-- Don't forget to add the gitmoji icon in the name of the PR -->
<!-- See: https://gitmoji.dev/                                  -->

<!-- Fixing bugs, adding features... may impact existing ones           -->
<!-- in order to track potential issues that could be related to your PR -->
<!-- please check the impacts and describe more precisely what to expect -->

**_Potential impacts:_**

<!-- Generated values: Can your change impact any of the existing generators in terms of generated values, if so which ones? when? -->
<!-- Shrink values:    Can your change impact any of the existing generators in terms of shrink values, if so which ones? when? -->
<!-- Performance:      Can it require some typings changes on user side? Please give more details -->
<!-- Typings:          Is there a potential performance impact? In which cases? -->
- [ ] Generated values
- [ ] Shrink values
- [ ] Performance
- [ ] Typings
- [ ] _Other(s):_ ...


codesandbox[bot]: This pull request is automatically built and testable in [CodeSandbox](https://codesandbox.io).

  To see build info of the built libraries, click [here](https://ci.codesandbox.io/status/dubzzz/fast-check/pr/2034/builds/143418) or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 747bf2477200270891ca3aaf131c2ba13277e481:

|Sandbox| Source |
|--|--|
|[Vanilla](https://codesandbox.io/s/vanilla-dodz7)| Configuration |
|[fast-check-examples](https://codesandbox.io/s/fast-check-examples-xk41c)| Configuration |

codecov[bot]: # [Codecov](https://codecov.io/gh/dubzzz/fast-check/pull/2034?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN) Report
> Merging [#2034](https://codecov.io/gh/dubzzz/fast-check/pull/2034?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN) (747bf24) into [main](https://codecov.io/gh/dubzzz/fast-check/commit/47dbc614ab4c8dc9fd09758853c4f4aceb4af800?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN) (47dbc61) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/dubzzz/fast-check/pull/2034/graphs/tree.svg?width=650&height=150&src=pr&token=fRi2fJN730&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN)](https://codecov.io/gh/dubzzz/fast-check/pull/2034?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN)

```diff
@@           Coverage Diff           @@
##             main    #2034   +/-   ##
=======================================
  Coverage   96.58%   96.58%           
=======================================
  Files         176      176           
  Lines        4332     4332           
  Branches      806      806           
=======================================
  Hits         4184     4184           
  Misses        144      144           
  Partials        4        4           
```

| Flag | Coverage Δ | |
|---|---|---|
| unit-tests | `96.58% <100.00%> (ø)` | |
| unit-tests-12.x-Linux | `96.58% <100.00%> (ø)` | |
| unit-tests-14.x-Linux | `?` | |
| unit-tests-16.x-Linux | `?` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/dubzzz/fast-check/pull/2034?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN) | Coverage Δ | |
|---|---|---|
| [src/arbitrary/sparseArray.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2034/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2FyYml0cmFyeS9zcGFyc2VBcnJheS50cw==) | `100.00% <100.00%> (ø)` | |
| [src/check/arbitrary/ObjectArbitrary.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2034/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2NoZWNrL2FyYml0cmFyeS9PYmplY3RBcmJpdHJhcnkudHM=) | `97.60% <100.00%> (ø)` | |
| [src/fast-check-default.ts](https://codecov.io/gh/dubzzz/fast-check/pull/2034/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN#diff-c3JjL2Zhc3QtY2hlY2stZGVmYXVsdC50cw==) | `100.00% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/dubzzz/fast-check/pull/2034?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/dubzzz/fast-check/pull/2034?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN). Last update [47dbc61...747bf24](https://codecov.io/gh/dubzzz/fast-check/pull/2034?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Nicolas+DUBIEN).


Patch:
diff --git a/src/check/arbitrary/SparseArrayArbitrary.ts b/src/arbitrary/sparseArray.ts
similarity index 91%
rename from src/check/arbitrary/SparseArrayArbitrary.ts
rename to src/arbitrary/sparseArray.ts
index 819c09eb..015b63b0 100644
--- a/src/check/arbitrary/SparseArrayArbitrary.ts
+++ b/src/arbitrary/sparseArray.ts
@@ -1,8 +1,8 @@
-import { Arbitrary } from './definition/Arbitrary';
-import { nat } from '../../arbitrary/nat';
-import { set } from '../../arbitrary/set';
-import { tuple } from '../../arbitrary/tuple';
-import { maxLengthFromMinLength } from '../../arbitrary/_internals/helpers/MaxLengthFromMinLength';
+import { Arbitrary } from '../check/arbitrary/definition/Arbitrary';
+import { nat } from './nat';
+import { set } from './set';
+import { tuple } from './tuple';
+import { maxLengthFromMinLength } from './_internals/helpers/MaxLengthFromMinLength';
 
 /**
  * Constraints to be applied on {@link sparseArray}
diff --git a/src/check/arbitrary/ObjectArbitrary.ts b/src/check/arbitrary/ObjectArbitrary.ts
index be084233..90515bc9 100644
--- a/src/check/arbitrary/ObjectArbitrary.ts
+++ b/src/check/arbitrary/ObjectArbitrary.ts
@@ -25,7 +25,7 @@ import { uint16Array } from '../../arbitrary/uint16Array';
 import { uint32Array } from '../../arbitrary/uint32Array';
 import { uint8Array } from '../../arbitrary/uint8Array';
 import { uint8ClampedArray } from '../../arbitrary/uint8ClampedArray';
-import { sparseArray } from './SparseArrayArbitrary';
+import { sparseArray } from '../../arbitrary/sparseArray';
 import { keyValuePairsToObjectMapper } from '../../arbitrary/_internals/mappers/KeyValuePairsToObject';
 
 /**
diff --git a/src/fast-check-default.ts b/src/fast-check-default.ts
index b11de2cf..64ccb72e 100644
--- a/src/fast-check-default.ts
+++ b/src/fast-check-default.ts
@@ -158,7 +158,7 @@ import { uint16Array } from './arbitrary/uint16Array';
 import { uint32Array } from './arbitrary/uint32Array';
 import { float32Array, Float32ArrayConstraints } from './arbitrary/float32Array';
 import { float64Array, Float64ArrayConstraints } from './arbitrary/float64Array';
-import { sparseArray, SparseArrayConstraints } from './check/arbitrary/SparseArrayArbitrary';
+import { sparseArray, SparseArrayConstraints } from './arbitrary/sparseArray';
 import { DoubleNextConstraints } from './check/arbitrary/DoubleNextArbitrary';
 import { NextArbitrary } from './check/arbitrary/definition/NextArbitrary';
 import { NextValue } from './check/arbitrary/definition/NextValue';


Test patch:
diff --git a/test/unit/check/arbitrary/SparseArrayArbitrary.itest.spec.ts b/test/unit/arbitrary/SparseArrayArbitrary.itest.spec.ts
similarity index 90%
rename from test/unit/check/arbitrary/SparseArrayArbitrary.itest.spec.ts
rename to test/unit/arbitrary/SparseArrayArbitrary.itest.spec.ts
index 32712bac..9592ec2d 100644
--- a/test/unit/check/arbitrary/SparseArrayArbitrary.itest.spec.ts
+++ b/test/unit/arbitrary/SparseArrayArbitrary.itest.spec.ts
@@ -1,7 +1,7 @@
-import { sparseArray, SparseArrayConstraints } from '../../../../src/check/arbitrary/SparseArrayArbitrary';
-import { nat } from '../../../../src/arbitrary/nat';
-import * as genericHelper from './generic/GenericArbitraryHelper';
-import fc from '../../../../lib/fast-check';
+import { sparseArray, SparseArrayConstraints } from '../../../src/arbitrary/sparseArray';
+import { nat } from '../../../src/arbitrary/nat';
+import * as genericHelper from '../check/arbitrary/generic/GenericArbitraryHelper';
+import fc from '../../../lib/fast-check';
 
 const validSparseArrayConstraints = () =>
   fc
diff --git a/test/unit/check/arbitrary/SparseArrayArbitrary.utest.spec.ts b/test/unit/arbitrary/SparseArrayArbitrary.utest.spec.ts
similarity index 89%
rename from test/unit/check/arbitrary/SparseArrayArbitrary.utest.spec.ts
rename to test/unit/arbitrary/SparseArrayArbitrary.utest.spec.ts
index d3205ce4..d5fd3f37 100644
--- a/test/unit/check/arbitrary/SparseArrayArbitrary.utest.spec.ts
+++ b/test/unit/arbitrary/SparseArrayArbitrary.utest.spec.ts
@@ -1,17 +1,17 @@
-import { sparseArray, SparseArrayConstraints } from '../../../../src/check/arbitrary/SparseArrayArbitrary';
-import { Arbitrary } from '../../../../src/check/arbitrary/definition/Arbitrary';
-import { Shrinkable } from '../../../../src/check/arbitrary/definition/Shrinkable';
+import { sparseArray, SparseArrayConstraints } from '../../../src/arbitrary/sparseArray';
+import { Arbitrary } from '../../../src/check/arbitrary/definition/Arbitrary';
+import { Shrinkable } from '../../../src/check/arbitrary/definition/Shrinkable';
 import { mocked } from 'ts-jest/utils';
 
-import fc from '../../../../lib/fast-check';
+import fc from '../../../lib/fast-check';
 
-import * as NatMock from '../../../../src/arbitrary/nat';
-import * as SetMock from '../../../../src/arbitrary/set';
-import * as TupleMock from '../../../../src/arbitrary/tuple';
-import { arbitraryFor } from './generic/ArbitraryBuilder';
-jest.mock('../../../../src/arbitrary/nat');
-jest.mock('../../../../src/arbitrary/set');
-jest.mock('../../../../src/arbitrary/tuple');
+import * as NatMock from '../../../src/arbitrary/nat';
+import * as SetMock from '../../../src/arbitrary/set';
+import * as TupleMock from '../../../src/arbitrary/tuple';
+import { arbitraryFor } from '../check/arbitrary/generic/ArbitraryBuilder';
+jest.mock('../../../src/arbitrary/nat');
+jest.mock('../../../src/arbitrary/set');
+jest.mock('../../../src/arbitrary/tuple');
 
 const validSparseArrayConstraints = (removedKeys: (keyof SparseArrayConstraints)[] = []) =>
   fc