-
-
Notifications
You must be signed in to change notification settings - Fork 171
Add 'watch' console message on files update #324
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
Conversation
|
CI is failing, could you check your linting? |
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.
It is better to add an option verbose to show those log or show it when debug is passed.
Because it will spam the logging during development. Only show it when it is needed.
Being I resolved the lint problem (thank you @mcollina) but I still have some problem with tests. Test errors seams related to |
|
This does the trick: |
|
can you add a test for the new feature? I have opened #325 to fix the tests., you might want to rebase after it lands |
Add console message output on files update before restarting fastify.
Add console message output on files update before restarting fastify.
Add console message output on files update before restarting fastify.
Add console message output on files update before restarting fastify.
|
|
We need a test that verifies that the said output is emitted. |
I'm so sorry, but I'm still a newbie with unit tests and With the last commit, I add the function to test The message is fired by this code inside test function await writeFile(tmpjs, 'hello fastify', { flag: 'a+' })Do you have any suggestion? Test output (as you can see after 3 result the message is printed in the console |
…watch console message . Added test.
mcollina
left a comment
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
|
@climba03003 could you take a look? |
climba03003
left a comment
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.
|
It's the first time writing a unit test, so I don't know if it could need some optimization. |
Problem
I faced an unexpected
fastify-cliforced end during my development activity after calling a route.The endpoint response was successfully executed by the server and sent to the client, but the process ends and restarts without any problem.
This got me into trouble to understand the reason.
Troubleshooting
In my development environment, I use a
sqlite3database stored in thedata/directory inside my project.After some troubleshooting, I found that the problem comes from
watchoption in therun devscriptIt should have the
--ignore-watchoption set with the data directorySuggestion
I think that the logging should provide more useful information to avoid thinking that the forced end is an error.
I suggest adding a console message that prints events triggered by
watchto understand the reason why the process is ended and restarted.New Output example (Standard)
New output example (useful to troubleshoot my problem)
Checklist
npm run testandnpm run benchmarkand the Code of conduct