Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practices for unit testing #9

Open
anderseknert opened this issue May 30, 2022 · 0 comments
Open

Best practices for unit testing #9

anderseknert opened this issue May 30, 2022 · 0 comments

Comments

@anderseknert
Copy link
Member

Some thoughts

  • Extend general advice to recommend test driven development
  • And add an "Exceptions" part to the recommendation on imports stating that importing rules directly is fine for tests.

Test section

  • Use different package name, and imports, for tests
    • Recommendation for naming test packages: same as the package under test, with either .test or _test appended?
    • Recommendation for naming test files: _test.rego suffix?

Additionally, I've seen a few questions about how to best organize tests, i.e. should they be in the same directory as packages being tested, or in a separate one? While not strictly about "Rego" the language, I think it makes sense to consider this for the guide as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant