The following tools are recommendations for testing Puppet code and modules:
- Puppet Development Kit - https://puppet.com/docs/pdk/2.x/pdk.html
- metadata-json-lint, included in PDK, validates your module metadata file.
- puppet-lint, included in PDK, validates Puppet code against the recommended language style guide.
- rspec-puppet-facts included in PDK, provides support for running rspec tests for your module's supported operating systems.
- rspec-puppet, included in PDK, provides an RSpec test framework for Puppet, https://rspec-puppet.com
- onceover. https://github.com/dylanratcliffe/onceover
- Rubocop, https://rubocop.org, a Ruby code analyzer.
If you are using host manifests (generally discouraged), you can use "puppet parser validate <file>" to validate syntax.