javascript - How to run callback with jest --watch -
i started learn reactjs yesterday (to used in next product), willing set dev environment i'm stuck jest...
having bluetooth lightbulb on desk (already op scripts etc..), want red light when tests launched jest --watch
fail (see create-react-app fb devs here) problem is, don't know how run callback after tests, seems no 1 ran issue on interwebz, no solution found yet me.
update:
i using log file grep:
lamp.rb
def ci if file.readlines("path/jest.log").grep(/failed/).any? file.truncate('path/jest.log', 0) fail_jest # method updates lightbulb :) (red blink) end rescue puts 'no jest log found :(' end
launching jest tests this: unbuffer npm run test |& tee tmp/jest.log
i still looking better solution !
thanks help
your problem not specific react or jest. when run jest tests, running node/npm command , when tests fail process exists unsuccessful exit code. same mechanism used make automated ci builds fail when tests don't pass. i'd suggest start research there , depending on lightbulb's api, should straight forward make fire events whenever process fails regardless of reason.
Comments
Post a Comment