-
-
Notifications
You must be signed in to change notification settings - Fork 897
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
base: next
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for fakerjs ready!Built without sensitive environment variables
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 { |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #3070 +/- ##
=======================================
Coverage 99.97% 99.97%
=======================================
Files 2776 2776
Lines 226260 226301 +41
Branches 592 596 +4
=======================================
+ Hits 226199 226246 +47
+ Misses 61 55 -6
|
…RS/faker into feat/numberToRomanNumerals
This is a draft, please check this