by bin_bash · 4y ago · 0 comments
What if I installed some dependency outside of my project?
What if I'm trying to test performance with `time make test`?
What if it failed due to a transitory error—or I'm simply trying to discover if it is transitory?
What if I made a change to the way the tests are run in the Makefile or a different file not in ./src? Like running `npm install`?
What if I want to set an environment variable or pass an argument to the test runner?
> What if I made a change to the way the tests are run in the Makefile or a different file not in ./src? Like running `npm install`?
> What if I want to set an environment variable or pass an argument to the test runner?
Those are all inputs. Unfortunately, Make isn't very good at tracking inputs (or outputs, for that matter: e.g. if we change an input back to some previous value, make will still rebuild rather than using the old result).
These days I find Nix to be a much more sane alternative to Make.
make -B test
to force a rerun?Next, you're assuming a JS engineer would know what the flag is (or even that such a flag exists) to force reruns. I've literally never used this flag in my (JS) career so I wouldn't expect anyone to know this.
Don't send engineers down some debugging rabbit hole just to save a few seconds when no changes happen. If you want this functionality, just use `jest --onlyChanged` in your own workflow and don't screw with everyone else's.
The engineer will know because it is their job to know.
(Yes I'm a huge fan of deterministic tests and running only what's necessary).