Consider these two scenarios:
- read "test1-config.json" from disk, into whatever most easy JSON-adjacent format makes sense for your lang
- just use the JSON-adjacent format directly
Isn't the difference between these that one requires coupling input configuration of the environment to the tests (possibly inclusive of env vars and OS concerns around file I/o), making running the tests more confusing/complicated in aggregate, while the other requires coupling input configuration to the tests, making the unit under test clearer but potentially less reflective of the overall system?
Effectively this is just an argument between integration tests and unit tests. Unit testers certainly have the rhetorical upper hand here, but I think the grug-brained developers among us feel that "the whole program should be a pure function."
That can ultimately be reduced to a P-NP problem.