-
-
Notifications
You must be signed in to change notification settings - Fork 208
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
chore: 582 - improving test coverage #608
Conversation
Signed-off-by: Sasa Cvetkovic <[email protected]>
if (largeArrayMechanism !== 'default') { | ||
if (largeArrayMechanism === 'json-stringify') { | ||
functionCode += `if (arrayLength && arrayLength >= ${largeArraySize}) return JSON.stringify(obj)\n` | ||
} else { |
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.
because validLargeArrayMechanisms
-> this throw will never happen (we get an early throw if largeArrayMechanism
is not default
or json-stringify
) so no need for it -> already covered by tests
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.
thats true
@@ -663,8 +659,6 @@ function buildArrayTypeCondition (type, accessor) { | |||
return buildArrayTypeCondition(subType, accessor) | |||
}) | |||
condition = `(${conditions.join(' || ')})` | |||
} else { |
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.
this case is not possible because validation of types schema is invalid: data/properties/ids/type must be equal to one of the allowed values
-> already covered by tests
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.
which line is already handling this already?
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.
Line 32 in c83cc32
function isValidSchema (schema, name) { |
switch
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.
concrete line
Line 88 in c83cc32
isValidSchema(options.schema[key], key) |
serializer.js: 98.85 -> 100% |
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.
lgtm
#582
Improving test coverage part 1
Checklist
npm run test
andnpm run benchmark
and the Code of conduct