question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test existence of Providers with properties

See original GitHub issue

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave “+1” or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

I have a stack that generates a lot of providers. I would like to write tests to ensure they exist and were created with specific properties. This doesn’t appear possible atm. It would be good to have something similar to toHaveResourceWithProperties but for providers. Please correct me if this is indeed possible.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jsteinichcommented, May 17, 2022

I understood issue. I am interested to work on it but not getting where to start. Will anyone like to help me ? @jsteinich @ansgarm @skorfmann

Are you in the cdk dev slack? You could ask specific questions in the terraform-cdk channel.

1reaction
jsteinichcommented, May 7, 2022

@aayushharwani-aidash This would be adding additional testing capabilities. Take a look here for more information on testing.

Technically this involves adding another function similar to this one, but for looking at the provider and maybe terraform.required_providers sections of the synthesized output: https://github.com/hashicorp/terraform-cdk/blob/a3338f49abc001dafe35833511392f45553b1a61/packages/cdktf/lib/testing/matchers.ts#L151

We would also want to update the testing docs to include the new functions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduction to Property Based Testing | by Nicolas Dubien
Property based testing relies on properties. It checks that a function, program or whatever system under test abides by a property. Most of...
Read more >
What's the correct way to test for existence of a property on a ...
I have a custom Javascript object that I create with new , and assign properties to based on creation arguments ...
Read more >
Choosing properties for property-based testing
But here's a common problem. Everyone who sees a property-based testing tool like FsCheck or QuickCheck thinks that it is amazing… but when...
Read more >
How to Check if a Property Exists in a JavaScript Object
The hasOwnProperty() method will check if an object contains a direct property and will return true or false if it exists or not....
Read more >
Property-Based Testing - Examples from Business ... - YouTube
I got excited about property -based testing after hearing John Hughes talk at Functional Conf 2016. I tried it that year with QuickCheck, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found