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.10.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.11.0
Choose a head ref
Loading
Showing with 1,535 additions and 2,121 deletions.
  1. +10 −0 .github/actions/comment-on-pr/action.yml
  2. +73 −0 .github/actions/comment-on-pr/index.cjs
  3. +9 −0 .github/actions/comment-on-pr/package.json
  4. +160 −0 .github/actions/comment-on-pr/yarn.lock
  5. +8 −0 .github/dependabot.yml
  6. +65 −53 .github/workflows/build-status.yml
  7. +32 −0 CHANGELOG.md
  8. +12 −12 README.md
  9. +1 −1 documentation/AdvancedArbitraries.md
  10. +40 −24 documentation/Arbitraries.md
  11. +5 −5 example/package.json
  12. +56 −58 example/yarn.lock
  13. +1 −0 jest.config.cjs
  14. +11 −0 jest.setup.js
  15. +2 −2 package.json
  16. +97 −28 src/check/arbitrary/RecordArbitrary.ts
  17. +1 −1 src/check/precondition/PreconditionFailure.ts
  18. +1 −1 src/check/runner/configuration/GlobalParameters.ts
  19. +1 −1 src/check/symbols.ts
  20. +26 −13 src/utils/stringify.ts
  21. +1 −1 test/e2e/AsyncScheduler.spec.ts
  22. +1 −1 test/e2e/GenerateAllValues.spec.ts
  23. +1 −1 test/e2e/ModelBased.spec.ts
  24. +1 −1 test/e2e/NoStackOverflowOnShrink.spec.ts
  25. +1 −1 test/e2e/PreConditionChecks.spec.ts
  26. +1 −1 test/e2e/RandomEnough.spec.ts
  27. +1 −1 test/e2e/ReplayCommands.spec.ts
  28. +2 −2 test/e2e/ReplayFailures.spec.ts
  29. +1 −1 test/e2e/Shadows.spec.ts
  30. +1 −1 test/e2e/SkipAllAfterTime.spec.ts
  31. +1 −1 test/e2e/StateFullArbitraries.spec.ts
  32. +1 −1 test/e2e/VerbosityChecks.spec.ts
  33. +1 −1 test/e2e/WithProvidedExamples.spec.ts
  34. +1 −1 test/e2e/arbitraries/Arbitrary.spec.ts
  35. +3 −2 test/e2e/arbitraries/ArrayArbitrary.spec.ts
  36. +2 −1 test/e2e/arbitraries/BigIntArbitrary.spec.ts
  37. +1 −1 test/e2e/arbitraries/CharacterArbitrary.spec.ts
  38. +1 −2 test/e2e/arbitraries/DoubleNextArbitrary.spec.ts
  39. +1 −2 test/e2e/arbitraries/FloatNextArbitrary.spec.ts
  40. +1 −1 test/e2e/arbitraries/FunctionArbitrary.spec.ts
  41. +1 −1 test/e2e/arbitraries/IntegerArbitrary.spec.ts
  42. +1 −1 test/e2e/arbitraries/LetRecArbitrary.spec.ts
  43. +1 −1 test/e2e/arbitraries/MemoArbitrary.spec.ts
  44. +1 −1 test/e2e/arbitraries/ObjectArbitrary.spec.ts
  45. +1 −1 test/e2e/arbitraries/OneOfArbitrary.spec.ts
  46. +1 −1 test/e2e/arbitraries/RecordArbitrary.spec.ts
  47. +2 −4 test/e2e/arbitraries/StringArbitrary.spec.ts
  48. +2 −1 test/e2e/arbitraries/SubarrayArbitrary.spec.ts
  49. +1 −1 test/e2e/arbitraries/TupleArbitrary.spec.ts
  50. +1 −1 test/e2e/arbitraries/WebArbitrary.spec.ts
  51. +1 −1 test/e2e/model/CommandsArbitrary.spec.ts
  52. +10 −0 test/e2e/seed.ts
  53. +2 −2 test/esm/rollup-with-import/package.json
  54. +8 −8 test/esm/rollup-with-import/yarn.lock
  55. +2 −2 test/esm/rollup-with-require/package.json
  56. +8 −8 test/esm/rollup-with-require/yarn.lock
  57. +2 −2 test/esm/webpack-with-import/package.json
  58. +53 −170 test/esm/webpack-with-import/yarn.lock
  59. +2 −2 test/esm/webpack-with-require/package.json
  60. +53 −170 test/esm/webpack-with-require/yarn.lock
  61. +0 −6 test/legacy/typescript-3.2/main.ts
  62. +0 −13 test/legacy/typescript-3.2/package.json
  63. +0 −20 test/legacy/typescript-3.2/yarn.lock
  64. 0 test/type/index.d.ts
  65. +0 −152 test/type/index.test-d.ts
  66. +213 −0 test/type/main.ts
  67. +2 −9 test/type/package.json
  68. 0 test/{legacy/typescript-3.2 → type}/tsconfig.json
  69. +170 −0 test/type/type-checker.ts
  70. +15 −1,193 test/type/yarn.lock
  71. +111 −16 test/unit/check/arbitrary/RecordArbitrary.spec.ts
  72. +11 −0 test/unit/check/precondition/Pre.spec.ts
  73. +8 −0 test/unit/check/runner/configuration/GlobalParameters.spec.ts
  74. +8 −0 test/unit/check/symbols.spec.ts
  75. +80 −0 test/unit/utils/stringify.spec.ts
  76. +129 −111 yarn.lock
10 changes: 10 additions & 0 deletions .github/actions/comment-on-pr/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Comment on PR'
description: 'Give more details regarding useful links for the commit (in PR)'
inputs:
token:
description: 'GITHUB_TOKEN'
default: ${{github.token}}
required: false
runs:
using: 'node12'
main: 'index.cjs'
73 changes: 73 additions & 0 deletions .github/actions/comment-on-pr/index.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
const core = require('@actions/core');
const github = require('@actions/github');
const { exec } = require('child_process');

const verboseLog = (...args) => {
core.info(args.join(' '));
};
const cleanErr = (err) => {
if (!err) return err;
const { stack, ...others } = err;
return others;
};
const execAsync = (command, options) => {
const prettyCmd = `exec(${JSON.stringify(command)}, ${JSON.stringify(options)}})`;
return new Promise((resolve) => {
verboseLog(`Call to ${prettyCmd}`);
exec(command, options, (err, stdout, stderr) => {
verboseLog(`Answer from ${prettyCmd}`);
verboseLog(`err:`, JSON.stringify(cleanErr(err)));
verboseLog(`stdout:`, stdout.toString());
verboseLog(`stderr:`, stderr.toString());
resolve({ err, stdout, stderr });
});
});
};

async function run() {
const context = github.context;
const token = core.getInput('token', { required: true });

if (context.eventName !== 'pull_request') {
core.setFailed(`comment-on-pr can only be used on pull_request`);
return;
}

const { err, stdout: commitMessage } = await execAsync('git log -1 --format=%s');
if (err && err.code) {
core.setFailed(`comment-on-pr failed to get back commit hash, failed with error: ${err}`);
return;
}
const commitMessageRegex = /^Merge ([a-f0-9]+) into ([a-f0-9]+)$/;
const m = commitMessageRegex.exec(commitMessage.trim());
if (!m) {
core.setFailed(`comment-on-pr invalid commit message encountered, got: ${commitMessage.trim()}`);
return;
}

const commitHash = m[1];
const packageUrl = `https://pkg.csb.dev/dubzzz/fast-check/commit/${commitHash.substring(0, 8)}/fast-check`;
const octokit = github.getOctokit(token);
const body =
`Give a try to https://github.com/dubzzz/fast-check/pull/${context.issue.number}/commits/${commitHash} with:\n\n` +
'```bash\n' +
`yarn add ${packageUrl}\n` +
`npm i ${packageUrl}\n` +
'```\n\n' +
'⚠️ Package might not be accessible yet. Wait for CodeSandbox.\n\n' +
'⚠️ By running one of these commands you will install the package defined by the head of the PR. But, tests are run against the result of the merge of the PR, not against the head of the PR*. *_If needed, you can install the package used for the tests by manually retrieving and installing the artifact bundle stored into GitHub Actions._\n\n' +
'Useful links: ' +
`[Codeclimate](https://codeclimate.com/github/dubzzz/fast-check/pull/${context.issue.number}), ` +
`[Codecov](https://codecov.io/gh/dubzzz/fast-check/pull/${context.issue.number}), ` +
`[CodeSandbox](https://ci.codesandbox.io/status/dubzzz/fast-check/pr/${context.issue.number}) and ` +
`[GitHub Actions](https://github.com/dubzzz/fast-check/actions/runs/${context.runId}).`;

await octokit.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body,
});
}

run().catch((err) => core.setFailed(`Failed with error: ${err}`));
9 changes: 9 additions & 0 deletions .github/actions/comment-on-pr/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "comment-on-pr",
"main": "index.cjs",
"private": true,
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/github": "^4.0.0"
}
}
160 changes: 160 additions & 0 deletions .github/actions/comment-on-pr/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@actions/core@^1.2.6":
version "1.2.6"
resolved "https://registry.yarnpkg.com/@actions/core/-/core-1.2.6.tgz#a78d49f41a4def18e88ce47c2cac615d5694bf09"
integrity sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA==

"@actions/github@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@actions/github/-/github-4.0.0.tgz#d520483151a2bf5d2dc9cd0f20f9ac3a2e458816"
integrity sha512-Ej/Y2E+VV6sR9X7pWL5F3VgEWrABaT292DRqRU6R4hnQjPtC/zD3nagxVdXWiRQvYDh8kHXo7IDmG42eJ/dOMA==
dependencies:
"@actions/http-client" "^1.0.8"
"@octokit/core" "^3.0.0"
"@octokit/plugin-paginate-rest" "^2.2.3"
"@octokit/plugin-rest-endpoint-methods" "^4.0.0"

"@actions/http-client@^1.0.8":
version "1.0.9"
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-1.0.9.tgz#af1947d020043dbc6a3b4c5918892095c30ffb52"
integrity sha512-0O4SsJ7q+MK0ycvXPl2e6bMXV7dxAXOGjrXS1eTF9s2S401Tp6c/P3c3Joz04QefC1J6Gt942Wl2jbm3f4mLcg==
dependencies:
tunnel "0.0.6"

"@octokit/auth-token@^2.4.4":
version "2.4.4"
resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.4.4.tgz#ee31c69b01d0378c12fd3ffe406030f3d94d3b56"
integrity sha512-LNfGu3Ro9uFAYh10MUZVaT7X2CnNm2C8IDQmabx+3DygYIQjs9FwzFAHN/0t6mu5HEPhxcb1XOuxdpY82vCg2Q==
dependencies:
"@octokit/types" "^6.0.0"

"@octokit/core@^3.0.0":
version "3.2.4"
resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.2.4.tgz#5791256057a962eca972e31818f02454897fd106"
integrity sha512-d9dTsqdePBqOn7aGkyRFe7pQpCXdibSJ5SFnrTr0axevObZrpz3qkWm7t/NjYv5a66z6vhfteriaq4FRz3e0Qg==
dependencies:
"@octokit/auth-token" "^2.4.4"
"@octokit/graphql" "^4.5.8"
"@octokit/request" "^5.4.12"
"@octokit/types" "^6.0.3"
before-after-hook "^2.1.0"
universal-user-agent "^6.0.0"

"@octokit/endpoint@^6.0.1":
version "6.0.10"
resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.10.tgz#741ce1fa2f4fb77ce8ebe0c6eaf5ce63f565f8e8"
integrity sha512-9+Xef8nT7OKZglfkOMm7IL6VwxXUQyR7DUSU0LH/F7VNqs8vyd7es5pTfz9E7DwUIx7R3pGscxu1EBhYljyu7Q==
dependencies:
"@octokit/types" "^6.0.0"
is-plain-object "^5.0.0"
universal-user-agent "^6.0.0"

"@octokit/graphql@^4.5.8":
version "4.5.8"
resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.5.8.tgz#d42373633c3015d0eafce64a8ce196be167fdd9b"
integrity sha512-WnCtNXWOrupfPJgXe+vSmprZJUr0VIu14G58PMlkWGj3cH+KLZEfKMmbUQ6C3Wwx6fdhzVW1CD5RTnBdUHxhhA==
dependencies:
"@octokit/request" "^5.3.0"
"@octokit/types" "^6.0.0"
universal-user-agent "^6.0.0"

"@octokit/openapi-types@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-2.0.1.tgz#7453d8281ce66b8ed1607f7ac7d751c3baffd2cc"
integrity sha512-9AuC04PUnZrjoLiw3uPtwGh9FE4Q3rTqs51oNlQ0rkwgE8ftYsOC+lsrQyvCvWm85smBbSc0FNRKKumvGyb44Q==

"@octokit/plugin-paginate-rest@^2.2.3":
version "2.6.2"
resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.6.2.tgz#45d13dbf5ff8aed54f1a3716b1d57fdc62720c5f"
integrity sha512-3Dy7/YZAwdOaRpGQoNHPeT0VU1fYLpIUdPyvR37IyFLgd6XSij4j9V/xN/+eSjF2KKvmfIulEh9LF1tRPjIiDA==
dependencies:
"@octokit/types" "^6.0.1"

"@octokit/plugin-rest-endpoint-methods@^4.0.0":
version "4.4.1"
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.4.1.tgz#105cf93255432155de078c9efc33bd4e14d1cd63"
integrity sha512-+v5PcvrUcDeFXf8hv1gnNvNLdm4C0+2EiuWt9EatjjUmfriM1pTMM+r4j1lLHxeBQ9bVDmbywb11e3KjuavieA==
dependencies:
"@octokit/types" "^6.1.0"
deprecation "^2.3.1"

"@octokit/request-error@^2.0.0":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.0.4.tgz#07dd5c0521d2ee975201274c472a127917741262"
integrity sha512-LjkSiTbsxIErBiRh5wSZvpZqT4t0/c9+4dOe0PII+6jXR+oj/h66s7E4a/MghV7iT8W9ffoQ5Skoxzs96+gBPA==
dependencies:
"@octokit/types" "^6.0.0"
deprecation "^2.0.0"
once "^1.4.0"

"@octokit/request@^5.3.0", "@octokit/request@^5.4.12":
version "5.4.12"
resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.4.12.tgz#b04826fa934670c56b135a81447be2c1723a2ffc"
integrity sha512-MvWYdxengUWTGFpfpefBBpVmmEYfkwMoxonIB3sUGp5rhdgwjXL1ejo6JbgzG/QD9B/NYt/9cJX1pxXeSIUCkg==
dependencies:
"@octokit/endpoint" "^6.0.1"
"@octokit/request-error" "^2.0.0"
"@octokit/types" "^6.0.3"
deprecation "^2.0.0"
is-plain-object "^5.0.0"
node-fetch "^2.6.1"
once "^1.4.0"
universal-user-agent "^6.0.0"

"@octokit/types@^6.0.0", "@octokit/types@^6.0.1", "@octokit/types@^6.0.3", "@octokit/types@^6.1.0":
version "6.1.2"
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.1.2.tgz#2b3a6ae0b8b71c27c770b4ff3e9ad8f1f538af58"
integrity sha512-LPCpcLbcky7fWfHCTuc7tMiSHFpFlrThJqVdaHgowBTMS0ijlZFfonQC/C1PrZOjD4xRCYgBqH9yttEATGE/nw==
dependencies:
"@octokit/openapi-types" "^2.0.1"
"@types/node" ">= 8"

"@types/node@>= 8":
version "14.14.16"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.16.tgz#3cc351f8d48101deadfed4c9e4f116048d437b4b"
integrity sha512-naXYePhweTi+BMv11TgioE2/FXU4fSl29HAH1ffxVciNsH3rYXjNP2yM8wqmSm7jS20gM8TIklKiTen+1iVncw==

before-after-hook@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.1.0.tgz#b6c03487f44e24200dd30ca5e6a1979c5d2fb635"
integrity sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==

deprecation@^2.0.0, deprecation@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919"
integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==

is-plain-object@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344"
integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==

node-fetch@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==

once@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
dependencies:
wrappy "1"

tunnel@0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/tunnel/-/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c"
integrity sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==

universal-user-agent@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee"
integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==

wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -117,6 +117,14 @@ updates:
# we run this test against a linked version of fast-check
# by using `yarn link "fast-check"`
- dependency-name: "fast-check"

- package-ecosystem: "npm"
directory: "/.github/actions/comment-on-pr"
schedule:
interval: "weekly"
commit-message:
prefix: "⬆️"

- package-ecosystem: github-actions
directory: /
schedule:
Loading