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

Issue #774: Adding support to location array #843

Closed
wants to merge 4 commits into from
Closed

Issue #774: Adding support to location array #843

wants to merge 4 commits into from

Conversation

cemarte
Copy link

@cemarte cemarte commented Feb 26, 2018

Hi,

This is my first time contributing, so let me know if I've done it correctly and how can I help with other issues. I've committed some changes to ./loades/utils/getComponentFiles.js, but not sure how to test it properly so codecov decreased a little. Can I follow the same pattern in styleguideloader.spec.js to get this part covered?

Thanks!

@codecov-io
Copy link

codecov-io commented Feb 26, 2018

Codecov Report

Merging #843 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted Files Coverage Δ
scripts/schemas/config.js 86.2% <ø> (ø) ⬆️
loaders/utils/getComponentFiles.js 100% <100%> (ø) ⬆️

Copy link
Member

@sapegin sapegin left a comment

Choose a reason for hiding this comment

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

Thanks!

Codecov is complainig about low coverage of the config.js itself, not your changes, they are fine — “The diff coverage is 100%.”

@@ -21,6 +22,8 @@ module.exports = function getComponentFiles(components, rootDir, ignore) {
let componentFiles;
if (isFunction(components)) {
componentFiles = components();
} else if (isArray(components)) {
Copy link
Member

Choose a reason for hiding this comment

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

Use Array.isArray.

@@ -35,12 +36,36 @@ it('should accept config as an object', () => {
expect(result).toMatchObject({ title: 'Style guide' });
});

it('should accept components as a string', () => {
Copy link
Member

Choose a reason for hiding this comment

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

These tests don’t add much (if any) value: you’re testing this line:

type: ['string', 'function', 'array'],

which is already tested in config sanitizer tests.

@@ -94,6 +94,34 @@ it('should return correct component paths: function returning absolute paths', (
expect(result).not.toMatch(`'filepath': 'components/RandomButton/RandomButton.js'`);
});

it('should return correct component paths: function returning absolute paths', () => {
Copy link
Member

Choose a reason for hiding this comment

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

function returning absolute paths → array of component absolute paths.

You can also add a test for relative paths.

@sapegin sapegin closed this in 5d9e52d Mar 30, 2018
@styleguidist-bot
Copy link
Collaborator

🎉 This issue has been resolved in version 7.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

None yet

4 participants