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 camelCase util function and use in test-helpers #32

Merged
merged 4 commits into from
Jan 29, 2018
Merged

Add camelCase util function and use in test-helpers #32

merged 4 commits into from
Jan 29, 2018

Conversation

wa-rren-dev
Copy link
Contributor

No description provided.

@wa-rren-dev
Copy link
Contributor Author

Also added a couple of items to .gitignore for my own dev environment

@@ -74,4 +74,14 @@ describe("Utils", function() {

});

describe('jQuery camelCase (private method)', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

These quotes should use " to pass linting rules

@@ -21,7 +21,7 @@ const { JSDOM } = jsdom;
*/
function renderComponent(name, data) {
var template = fs.readFileSync(path.join(__dirname, `../src/components/${ name }/${ name }.njk`), "utf8");
return nunjucks.renderString(`${ template}{{ ${ name }(content) }}"`, { content: data });
return nunjucks.renderString(`${ template}{{ ${ $.camelCase(name) }(content) }}"`, { content: data });
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you remove the extra double quotes?

Test helper nunjucks render function presumed that a file's macro would match the file name - replaced with a camelCase template name
Copy link
Contributor

@ediblecode ediblecode left a comment

Choose a reason for hiding this comment

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

Nice!

@ediblecode ediblecode changed the title $.camelCase into test helper render & test for $.camelCase Add camelCase util function and use in test-helpers Jan 29, 2018
@ediblecode ediblecode merged commit 3a3c97c into nice-digital:master Jan 29, 2018
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.

2 participants