-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 2 letter state generator #233
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution!
Oops, I was too late here. But I think you forgot to push a minor version, so maybe not too late for my comments to be taken into account 😉
@@ -26,6 +26,7 @@ describe('the default export', function () { | |||
const values = ['a', 'b', 'c']; | |||
expect(values).toContain(fake.sample(values)); | |||
expect(fake.digit()).toEqual(expect.any(Number)); | |||
expect(fake.state()).toEqual(expect.any(String)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a comment at the top of this file that says this file shouldn't really exist! We should be adding new/updated tests to their own method-specific files.
Oh, which you did actually! So just remove this line please.
@@ -245,6 +245,14 @@ Chooses one of the elements of the provided `array`. The given array cannot be e | |||
|
|||
`() => string` | |||
|
|||
Generates a random sentence beginning with a capitalized letter and ending with a period. | |||
|
|||
#### `fake.state` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps preemptively nest this under fake.location
? See #76.
Currently the way we fake state codes in Garbanzo is to generate a random two letter string, without checking if it is a state or not (see here). It would be more convenient if fake-eggs handled this.