In testing/test-nx-utils/src/lib/utils/nx.unit.test.ts there should be no need for conditional statements in tests. The test should know what is expected and not insert any default values such as {}. I would suggest using ! here. JSON.parse(tree.read('nx.json')!.toString())
Leftover of https://github.com/code-pushup/cli/pull/777:
JSON.parse(tree.read('nx.json')!.toString())