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

Example: how to unit test a component resource #1063

Merged

Conversation

jandom
Copy link
Contributor

@jandom jandom commented Aug 20, 2021

An example that would have really helped me in the past – when I started breaking things up into Component Resources, I really missed any notes on how to test. It's possible to figure it out but some "best practice" would be great

https://www.pulumi.com/docs/intro/concepts/resources/#components

Especially in the tutorial on Component Resources, there is no mention on unit testing them in isolation
https://www.pulumi.com/docs/tutorials/aws/s3-folder-component/

I may have done too much here – sub-foldered into mocha/ , changed how mocha is called (to use the node_modules, rather than a global install)

@github-actions
Copy link

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-example-tests on the PR

Copy link
Member

@pierskarsenbarg pierskarsenbarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but one comment/suggestion for completeness

testing-unit-ts/mocha/bucket_pair.ts Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Sep 1, 2021

PR is now waiting for a maintainer to run the acceptance tests.

Note for the maintainer: To run the acceptance tests, please comment /run-example-tests on the PR

@pierskarsenbarg
Copy link
Member

/run-example-tests

@github-actions
Copy link

github-actions bot commented Sep 1, 2021

Please view the results of the PR Build Here

@pierskarsenbarg pierskarsenbarg merged commit f9aeb34 into pulumi:master Sep 14, 2021
@jandom
Copy link
Contributor Author

jandom commented Sep 14, 2021

Nice, many thanks for the merge @pierskarsenbarg

@pierskarsenbarg
Copy link
Member

Thank you for the PR 😀

dixler pushed a commit that referenced this pull request Jan 21, 2022
* Example how to unit test a component resource

* Update testing-unit-ts/mocha/bucket_pair.ts

Co-authored-by: Piers Karsenbarg <[email protected]>
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

Successfully merging this pull request may close these issues.

None yet

2 participants