Hi forks, is it possible to 'restart' the pulumi ...
# automation-api
v
Hi forks, is it possible to 'restart' the pulumi runtime after a test in the
after
hook during the tests?
l
Are you talking about unit tests in something like Mocha or Jest? If you call setMocks() during beforeEach(), or anywhere that's run before each it(), then you achieve that.
v
Not the mock part. I have codes for the transforms which touch the runtime, it set stuff in the runtime for next test suit. Just wonder if there is a way to ‘reset’ or clean the runtime to default.
l
Ah yes. I have (very, very old....) tests for transforms, I'll see if I do that...
🙏 1
My solution was to create a runtime for each it(), describe() or context() that requires it. Here's a simple example.
runInPulumiStack()
being the magic at work here.
v
Thanks very much. Let me have a try.