-
-
Notifications
You must be signed in to change notification settings - Fork 919
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
feat(number): add romanNumeral method #3070
Conversation
✅ Deploy Preview for fakerjs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Please add tests for romanNumeral
In this commit 7abd2c7 i created a new function intToRomanNumeral so where should i place it ? |
How should i write random seeded test for "it('should generate a Roman numeral between 1 and 10')" ? Since i don't what answer will be. |
And there will be no value range test ? |
There's a few ways you could do it. For 1 to 10 you could check if it's any of the values from I to X by listing all 10 values. You could also check it only contains suitable characters. Also add tests that check hitting each of the errors and check appropriate error is thrown. |
Please let me know if there are any changes with the code and test if not i will run preflight and then commit the code |
Ideally please run preflight after every change. This will help catch any minor syntax errors etc so the reviewers can focus on the logic of your code rather than nitpicking. |
I ran into an error during preflight |
its not a very intuitive error message but i think the problem is that you're missing a add
|
The error is not caused by FakerApiDocsProcessingError: Failed to process property 'options.min' at src/modules/number/index.ts:467:36 : Expected exactly one element for jsdocs, got 0 The options object should be defined like this: romanNumeral(
options:
| number
| {
/**
* Lower bound for generated number.
*
* @default 1
*/
min?: number;
/**
* Upper bound for generated number.
*
* @default 3999
*/
max?: number;
} = {}
): string { |
@AmaanRS Could you please address the requested changes? |
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.
One last change, then this is good to go.
Please also change the description of the PR to something explaining the feature in more detail. A few sentences are sufficient. |
@Shinigami92 and @import-brain Could you please re-review this PR (or dismiss your stale reviews)? |
@AmaanRS Thanks for your first contribution. ❤️ This feature will be released in Faker v9.2, which will probably release shortly (a week to a few weeks). |
Adds #2649
Adds a method for generating random romanNumerals:
Documentation