cli
cli copied to clipboard
improve test-nx-utils testing
Leftover of https://github.com/code-pushup/cli/pull/777:
- each test in testing/test-nx-utils/src/lib/utils/tree.integration.test.ts should clean up after itself (the strategy is on our Wiki).
- 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())
- In testing/test-nx-utils/src/lib/utils/nx.unit.test.ts to get auto-complete if there is a non-trivial type to match, you can use satisfies or a type argument. Applicable in multiple places.