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

Fix file matching when dot appears before extension #55

Merged
merged 7 commits into from
Dec 3, 2018

Conversation

cemremengu
Copy link
Contributor

@cemremengu cemremengu commented Nov 24, 2018

Closes #53

I didn't know how to add a unit test for this. Any ideas are appreciated.

There might be better ways to solve this as well.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

You can test this by creating a temp directory with a . inside it. Write a js file in there that uses fastify-plugin, and then load it.

Or (simpler), move that regexp logic into another file, and write some tests for it.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM


const anonymousStack = `Unable to parse this`

test('should extract plugin name correctly from stack', t => {
Copy link
Member

Choose a reason for hiding this comment

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

nit: I don't think there is the need here to use test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, can you elaborate a bit? You mean it should be t.test ?

Copy link
Member

Choose a reason for hiding this comment

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

you can completely remove the t.test part, the script will work anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I didn't know it could be used like that 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mcollina let me me know if this is ok to patch in when you have time

Copy link
Member

@delvedor delvedor left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

LGTM

@cemremengu
Copy link
Contributor Author

Lacking permissions

@mcollina mcollina merged commit e0bbba6 into fastify:master Dec 3, 2018
@cemremengu cemremengu deleted the fix-fileregex branch December 3, 2018 22:50
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.

3 participants