Skip to content

Commit 2e18f24

Browse files
committed
Better readme
1 parent 04466fc commit 2e18f24

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ types to ensure the consuming program agrees with the data it is receiving.
88

99
[Fast-check](https://github.com/dubzzz/fast-check) is a Property Testing
1010
framework for `Typescript` / `Javascript`. It allows testing properties of a
11-
program using arbitrarily generated data. `Fast-check` uses `Arbitrary`s to
11+
program using arbitrarily generated data. `Fast-check` uses `arbitrary`s to
1212
create data, that is, descriptions of the data we need to create.
1313

1414
Say we have this datatype...
@@ -21,7 +21,7 @@ interface Person {
2121
}
2222
```
2323

24-
...the arbitrary would look like:
24+
...the code to make the `fast-check` `arbitrary` would look like:
2525

2626
```typescript
2727
import * as fc from "fast-check";
@@ -33,7 +33,8 @@ const personArbitrary = fc.record({
3333
```
3434

3535
This can then be used in property tests or as generators to create sample test
36-
data.
36+
data. The problem is that writing them all by hand and keeping them up to date
37+
with your datatypes is a pain.
3738

3839
## This library
3940

@@ -43,3 +44,31 @@ This library is a plugin for `GraphQL Code Generator` that creates `fast-check`
4344
## How to use
4445

4546
_ahem_
47+
48+
## What's working?
49+
50+
[X] Object types
51+
[X] Built-in Scalar types
52+
[X] Enumeration types
53+
[X] Type modifiers (1)
54+
[ ] Custom Scalar types (2)
55+
[X] Union types
56+
[X] Interface types (3)
57+
[ ] Input types (4)
58+
[ ] Documents (5)
59+
60+
1. Currently lists work but we ignore the nullable / non-nullable distinction.
61+
Everything is non-nullable for now, this will come soon.
62+
2. Custom Scalar types are defined outside the schema, frustratingly. For now
63+
they all emit a `string`, the plan is to allow the config to specify a file
64+
to override these with the user's own `arbitrary` instances.
65+
3. These "work" but need to check whether they are actually correct
66+
4. Currently these just output a `string` (why? don't know) - `fast-check` has
67+
a `func` `arbitrary` which should make this fairly straightforward to
68+
implement.
69+
5. I haven't even thought about tackling this part yet.
70+
71+
## Inspiration
72+
73+
Thanks to [fast-check-io-ts](https://www.npmjs.com/package/fast-check-io-ts)
74+
for showing me that making `arbitrary` instances should be easy.

0 commit comments

Comments
 (0)