question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

onchange fire by itself (ts-node related)

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
unionalcommented, Jul 27, 2016

Thank! That’s really helpful.

I discovered the issue is within the project test cases themselves.

1reaction
Qardcommented, Jul 27, 2016

{{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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found