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 random ENUM values #338

Merged
merged 8 commits into from
May 26, 2020
Merged

Conversation

artem1458
Copy link
Contributor

Added feature random-enums

@uittorio uittorio self-requested a review May 25, 2020 15:34
@Pmyl
Copy link
Collaborator

Pmyl commented May 25, 2020

Could you add some unit tests to cover the const enum case?

const enum Direction {
    Up,
    Down,
    None = 'Nothing'
}

interface Movement {
    direction: Direction;
}

@Pmyl
Copy link
Collaborator

Pmyl commented May 25, 2020

I know I'm pedantic... I just created #339 due to the fact that we currently don't support enums with computed values.
Luckily computed values don't break the unit tests when mocking enums but I'm concerned about this new feature, could you try to add some tests to cover the computed values? I would like for it to not fail, since we don't support them yet they don't have to work completely, as long as the test doesn't break I'm happy with it.
We will think about adding computed values support later.
@uittorio let me know if you agree

Artem Kornev and others added 4 commits May 26, 2020 10:32
Now, if we can't access to one of enum values, instead of "0" we're set it's position
Added tests for case, when enum imported from d.ts files, and we can't access to it values
@uittorio
Copy link
Member

uittorio commented May 26, 2020

Happy with the changes. @Pmyl about computed values I agree, @artem1458 added a test as well, so when we will fix it we'll ensure that the random functionality will work as expected

Great work!!!!

@uittorio uittorio merged commit eeceea2 into Typescript-TDD:master May 26, 2020
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