Skip to content
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

Merged
merged 1 commit into from
Nov 15, 2021
Merged

Conversation

aliceslin91
Copy link
Contributor

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.

Copy link
Contributor

@risharma risharma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aliceslin91 aliceslin91 merged commit 6b82663 into master Nov 15, 2021
@aliceslin91 aliceslin91 deleted the feat/add-state-generator branch November 15, 2021 18:32
Copy link
Contributor

@serhalp serhalp left a 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));
Copy link
Contributor

@serhalp serhalp Nov 15, 2021

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`
Copy link
Contributor

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.

This was referenced Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants