Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dubzzz/fast-check
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.0
Choose a base ref
...
head repository: dubzzz/fast-check
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.1.0
Choose a head ref
Loading
Showing with 2,257 additions and 1,427 deletions.
  1. +34 −0 .github/workflows/codeql-analysis.yml
  2. +23 −0 CHANGELOG.md
  3. +5 −5 MIGRATION_1.X_TO_2.X.md
  4. +3 −3 documentation/1-Guides/Tips.md
  5. +12 −10 example/package.json
  6. +717 −646 example/yarn.lock
  7. +1 −1 package.json
  8. +1 −2 src/check/arbitrary/ConstantArbitrary.ts
  9. +41 −16 src/check/arbitrary/FunctionArbitrary.ts
  10. +13 −13 src/check/arbitrary/ObjectArbitrary.ts
  11. +0 −12 src/check/arbitrary/helpers/ArrayHelper.ts
  12. +5 −0 src/check/arbitrary/helpers/TextEscaper.ts
  13. +2 −0 src/fast-check-default.ts
  14. +37 −6 src/utils/hash.ts
  15. +452 −72 test/e2e/__snapshots__/NoRegression.spec.ts.snap
  16. +1 −1 test/e2e/arbitraries/FunctionArbitrary.spec.ts
  17. +8 −14 test/esm/node-extension-cjs/yarn.lock
  18. +8 −14 test/esm/node-extension-mjs/yarn.lock
  19. +8 −14 test/esm/node-with-import/yarn.lock
  20. +8 −14 test/esm/node-with-require/yarn.lock
  21. +8 −14 test/esm/rollup-with-import/yarn.lock
  22. +8 −14 test/esm/rollup-with-require/yarn.lock
  23. +1 −1 test/esm/webpack-with-import/package.json
  24. +27 −33 test/esm/webpack-with-import/yarn.lock
  25. +1 −1 test/esm/webpack-with-require/package.json
  26. +27 −33 test/esm/webpack-with-require/yarn.lock
  27. +12 −13 test/legacy/typescript-3.2/package.json
  28. +8 −14 test/legacy/typescript-3.2/yarn.lock
  29. +1 −2 test/type/package.json
  30. +8 −14 test/type/yarn.lock
  31. +52 −0 test/unit/check/arbitrary/FunctionArbitrary.spec.ts
  32. +1 −0 test/unit/check/arbitrary/ObjectArbitrary.spec.ts
  33. +12 −0 test/unit/check/arbitrary/OptionArbitrary.spec.ts
  34. +0 −46 test/unit/check/arbitrary/helpers/ArrayHelper.spec.ts
  35. +25 −1 test/unit/check/arbitrary/helpers/TextEscaper.spec.ts
  36. +286 −0 test/unit/utils/hash.spec.ts
  37. +401 −398 yarn.lock
34 changes: 34 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "CodeQL"

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
analyse:
name: Analyse
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: javascript

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# 2.1.0

_Better reported errors for `func`, `compareFunc` and `compareBooleanFunc`_
[[Code](https://github.com/dubzzz/fast-check/tree/v2.0.0)][[Diff](https://github.com/dubzzz/fast-check/compare/v2.0.0...v2.1.0)]

## Features

- ([PR#843](https://github.com/dubzzz/fast-check/pull/843)) Report a valid `function` on `func` and `compareFunc`
- ([PR#844](https://github.com/dubzzz/fast-check/pull/844)) Export internal `hash` function
- ([PR#845](https://github.com/dubzzz/fast-check/pull/845)) Rewrite `hash` without using node specific APIs

## Fixes

- ([PR#833](https://github.com/dubzzz/fast-check/pull/833)) CI: Enable CodeQL Analysis
- ([PR#837](https://github.com/dubzzz/fast-check/pull/837)) Clean: Remove usages of `!` operator in `ObjectArbitrary`
- ([PR#838](https://github.com/dubzzz/fast-check/pull/838)) Clean: Remove custom implementation of `Array.prototype.find`
- ([PR#816](https://github.com/dubzzz/fast-check/pull/816)) Doc: Fix typos in migration guide
- ([PR#846](https://github.com/dubzzz/fast-check/pull/846)) Doc: Update links for `pika.dev` to `skypack.dev`
- ([PR#819](https://github.com/dubzzz/fast-check/pull/819)) Test: Better test coverage for `fc.option`
- ([PR#818](https://github.com/dubzzz/fast-check/pull/818)) Test: Reduce flakiness of coverage

---

# 2.0.0

_Hybrid and full support for both ES Modules and CommonJS_
10 changes: 5 additions & 5 deletions MIGRATION_1.X_TO_2.X.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Migration 1.x to 2.x

Migration from version `1.x` to `2.x` of fast-check should be pretty straightforward as no major breaking changes have been released.
Nonetheless as some of the changes may break existing code, a mojor bump have been required.
Nonetheless as some of the changes may break existing code, a major bump has been required.

The following documentation describes what has to be updated and how in case you encounter some troubles during this migration.

Most of the time the migration will just require to run one of the following command:
Most of the time the migration will just require to run one of the following commands:

```bash
# For yarn users
@@ -68,7 +68,7 @@ Associated Pull Requests: [#755](https://github.com/dubzzz/fast-check/pull/755)

## No more browser build

In previous major, fast-check was building a specific bundle for browsers. This bundle was easily *fetch-able* from CDNs like unpkg.
In the previous major, fast-check was building a specific bundle for browsers. This bundle was easily *fetch-able* from CDNs like unpkg.

Example of bundled version of fast-check: https://unpkg.com/browse/fast-check@1.22.1/lib/bundle.js

@@ -80,7 +80,7 @@ If the browsers you are targeting are compatible with esm-modules, you can impor

```html
<script type="module">
import fc from "https://cdn.pika.dev/fast-check";
import fc from "https://cdn.skypack.dev/fast-check";
// code...
</script>
```
@@ -99,7 +99,7 @@ You can also produce a minified version of the bundle by running:
npx -p browserify -p terser -c "browserify node_modules/fast-check/lib/fast-check.js --s fastcheck | terser -c -m > node_modules/fast-check/lib/bundle.js"
```

For support of older browsers, you mayb have a look to [babelify](https://github.com/babel/babelify).
For support of older browsers, you may have a look to [babelify](https://github.com/babel/babelify).

Associated Pull Requests: [#756](https://github.com/dubzzz/fast-check/pull/756)

6 changes: 3 additions & 3 deletions documentation/1-Guides/Tips.md
Original file line number Diff line number Diff line change
@@ -722,15 +722,15 @@ import fc from 'fast-check';
Deno:
```js
import fc from "https://cdn.pika.dev/fast-check";
import fc from "https://cdn.skypack.dev/fast-check";
```
Web Browser:
```html
<script type="module">
import fc from "https://cdn.pika.dev/fast-check";
import fc from "https://cdn.skypack.dev/fast-check";
// code...
</script>
```
More details on [pika](https://www.pika.dev/npm/fast-check/code).
More details on [pika](https://www.pika.dev/npm/fast-check/).
22 changes: 12 additions & 10 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -6,22 +6,22 @@
"test": "jest"
},
"dependencies": {
"@testing-library/dom": "^7.21.4",
"@testing-library/jest-dom": "^5.11.1",
"@testing-library/react": "^10.4.7",
"@testing-library/user-event": "^12.0.13",
"@testing-library/dom": "^7.22.0",
"@testing-library/jest-dom": "^5.11.2",
"@testing-library/react": "^10.4.8",
"@testing-library/user-event": "^12.1.0",
"fast-check": "*",
"lodash": "^4.17.19",
"pure-rand": "^3.0.0",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"devDependencies": {
"@types/jest": "^26.0.7",
"@types/lodash": "^4.14.158",
"@types/react": "^16.9.43",
"jest": "^25.5.4",
"ts-jest": "^25.5.1",
"@types/jest": "^26.0.9",
"@types/lodash": "^4.14.159",
"@types/react": "^16.9.44",
"jest": "^26.2.2",
"ts-jest": "^26.1.4",
"typescript": "^3.9.7"
},
"author": "Nicolas DUBIEN <github@dubien.org>",
@@ -37,6 +37,8 @@
"transform": {
"^.+\\.(ts|tsx)$": "ts-jest"
},
"setupFilesAfterEnv": ["<rootDir>/jest.setup.js"]
"setupFilesAfterEnv": [
"<rootDir>/jest.setup.js"
]
}
}
Loading