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.4.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.4.1
Choose a head ref
  • 4 commits
  • 4 files changed
  • 1 contributor

Commits on Nov 7, 2020

  1. Copy the full SHA
    42251bd View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    aduh95 Antoine du Hamel
    Copy the full SHA
    ab53e8b View commit details
  3. Verified

    This commit was signed with the committer’s verified signature.
    tpoisseau tpoisseau
    Copy the full SHA
    6461192 View commit details
  4. 2.4.1

    dubzzz committed Nov 7, 2020
    Copy the full SHA
    8863461 View commit details
Showing with 9 additions and 3 deletions.
  1. +2 −1 .travis.yml
  2. +1 −1 package.json
  3. +2 −1 src/check/arbitrary/RecordArbitrary.ts
  4. +4 −0 test/type/index.test-d.ts
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -100,7 +100,8 @@ jobs:
edge: true
cleanup: false
email: npm@dubien.org
tag: legacy
api_token:
secure: uh9D3ESY6ea+sVoe5NhhilSSw9qM6UGO0uiDLya0Bu96O30yqkTHKWVcxBADWmQTpC39uapq1g7pQ/ybiTlhuWymL2dcsJyGgCDSgBA5LXkAhgt+0j1JbWQRajAt9N1+RPXWMaGMdWOJnl6v5qrzR+9WgXUlo3zjulMtGMPYjkN22cUdFLKl4jEadwcAJJvKVXvS9LbWeD/g46TopPOgIAEn008EySzpBtpBHa2O0pWH6yCpHLqhk0vUz7ltIjO3khxD6EcrvcPjdIMI9swc8JIvXn4LK24z0mjzLaQOwlrjSbkPQ7Kf172lKOX2DC1hQQHYRGIPw2ln3KGMRwhTUayErjB1uM6x9l0eGmESzmVEsizjb5DbAnh+j/UWG+lEelxbp+PmTm0b1goF3Lmc6eK5IGkaa212UX4+zjK06Gkyu/c9nfeT2v3GPMlNTQoDWMFZvMuk6d+QVHXBlkh6zBdQ5NWoCz+fBegVD6wK24Lf1+HH83T3jk7OWcvNpru9B3D2L/u6LTHF2C/Ij01HWcvtavlRaJo1JJYbsysM9zxLydMR2BrwzQkoPLXoqj5Ambk8NoSPAARp63h82YRkJwAygqHhbaNgofOTy8iqLmZXqfQPXH7/0DGh4E0QXcdhcRuhZC315LARZAbJ0RVhc2wFJ+EqFYPJEeAFbKT5x28=
secure: SAy02qXQyzzQmpiT05unuCX73sR1RP+dkrWLfGEwOYNGO4cBRK0HgDlPDFt8bfvmN8qK3hlieUqf9tanLkdc3novRB7MhbLuBZoiTybPUj6aRlNUDuee0VemSRLSuaR1pB6hAgOMxR0FVRzy6xxo+s0jRaSq36aYKK4r/7fC83wY0r5/n9nE07ZuXMUlHauFhA5MHNkq8SQbax3x57DRHoK6rnxdyoCpCsPf70h4cRJj8QAa53XYrbEclec4ygmWfMiOZuQQDLW3WL4t6lsow/yCmh1H82qAsf3Tnwh7SMu77pxuBUg3h9zpNPYTPt785NtwpF0FEB7dckzqtXXn5zwhrv4XB5N7OcuIxVoNJ98RaNd9lUMBlUaHv25jXH1is4OHjj1wK6r6ovLiGQWWsPKJzo46iRCQ7VbDq91ZLzUUiPyUZf23ex88I1ysRvDbJDM0qJNw/+it2t9HuFW/MPL0syUnCxmVrYRyvoNFRzmV/qzrrsumgUkR1csuFed7lHEwpKAO79pkRil0ir6fS5DmUJODZwr4X8oILTCmWLFlg97Mc9ZjOPnLodUMw7K4nT8X2F8VahmEFAPKcJ9ALRPTS1Cg7nWNm5GoMMRqUNbjkA9/GPnNxyR5L9y8FaPfLiZYjiFscv1JLyRazcPmk1kRKcQFRUUqPQx23V4Sg1Q=
on:
tags: true
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fast-check",
"version": "2.4.0",
"version": "2.4.1",
"description": "Property based testing framework for JavaScript (like QuickCheck)",
"type": "commonjs",
"main": "lib/fast-check.js",
3 changes: 2 additions & 1 deletion src/check/arbitrary/RecordArbitrary.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,8 @@ export interface RecordConstraints {
* given the type of the source arbitrary and constraints to be applied
* @public
*/
export type RecordValue<T, Constraints = undefined> = Constraints extends {
// eslint-disable-next-line @typescript-eslint/ban-types
export type RecordValue<T, Constraints = {}> = Constraints extends {
withDeletedKeys: true;
}
? Partial<T>
4 changes: 4 additions & 0 deletions test/type/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -70,6 +70,10 @@ expectType<fc.Arbitrary<1 | 2 | 'hello'>>(fc.constantFrom(...([1, 2, 'hello'] as

// record arbitrary
expectType<fc.Arbitrary<{ a: number; b: string }>>(fc.record({ a: fc.nat(), b: fc.string() }));
expectType<fc.Arbitrary<{ a: number; b: string }>>(fc.record({ a: fc.nat(), b: fc.string() }, {}));
expectType<fc.Arbitrary<{ a: number; b: string }>>(
fc.record({ a: fc.nat(), b: fc.string() }, { withDeletedKeys: false })
);
expectType<fc.Arbitrary<{ a?: number; b?: string }>>(
fc.record({ a: fc.nat(), b: fc.string() }, { withDeletedKeys: true })
);