onchange fire by itself (ts-node related)
See original GitHub issueI use onchange
in npm script to watch file changes to re-run tests.
I notice for some reason onchange
has detect changes out of nowhere and keep rerunning the tests
I look at the files and notice .git/FETCH_HEAD
is updating continuously. I believe it is done by VSCode.
However, my onchange
call does not listen to the .git
folder (of course).
My call is onchange -w -i \"src/**/*.ts\ -- npm run test-spec
I tried to exclude the folder onchange -w -i \"src/**/*.ts\" -e \"**/.DS_Store\" -e \".git/*\" -- npm run test-spec
but it still keep running by itself. So FETCH_HEAD may not be the cause.
You can see / try the call here: https://github.com/typings/core/tree/add-jspm
Don’t know if it would be reproducible.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
onchange event not fire when the change come from another ...
From the fine manual: change. The change event occurs when a control loses the input focus and its value has been modified since...
Read more >onChange event is not firing · Issue #450 - GitHub
For some reason I've got the issue - onChange event is not firing. ... And the issue is most likely app related. As...
Read more >Solved: Onchange event often triggers when screen becomes
I get a notification that should only be displayed when a user is trying to change the date. It doesn't happen every time...
Read more >Simulate React On-Change On Controlled Components
You can bail out of this logic secretly by tagging the event you trigger with a simulated flag and React will always fire...
Read more >How to Identify Different Inputs with One Onchange Handler
The onChange event watches for changes in an input field. ... target property has the ID of that input field attached as a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank! That’s really helpful.
I discovered the issue is within the project test cases themselves.
{{event}}
and{{changed}}
are templates that get replaced anywhere in the command after the--
. You could try something like/bin/sh -c "echo '{{event}} to {{changed}}' && my-command"
to combine two commands. You’ll have to make sure you escape the double quotes properly, if you put that in your package.json file.