With the 1.58.0 update all of my tests fail with the following error:
unexpected: all stacks must be part of a Stage or an App
All of these tests pass under 1.57.0, and reading the release notes for 1.58.0 it seems like the code below should still work.
const stack = new Stack();
new Bucket(stack, 'bucket');
expectCDK(stack).to(haveResource('AWS::S3::Bucket'));
The test fails with the following error:
unexpected: all stacks must be part of a Stage or an App
I thought what the heck, make an app and pass that into the stack as its scope, but even with that I still got the same error.
This is :bug: Bug Report
I am having the same issue with 1.58.0 update.
Having the same issue as well with 1.58.0
+1
I suspect this might be a result of multiple versions of CDK modules in your node_modules
. Can you please verify your package.json
uses the same version for all CDK modules, nuke your node_modules
and re-run npm install
(or yarn install
)?
Please comment if the proposed solution did not work.
Clearing out the node_modules
folder wasn't enough for me, I had to nuke the package-lock.json
too. Seems to be every CDK upgrade I'm having to do this. It's getting a bit boring now! 馃槥
I am having the same issue with 1.68.0
I was having the same issue with 1.69.0, I tried to clean node_modules folder etc. but it didn't help. Now 1.70.0 upgrade fixed the issue.
Having the same problem even with 1.70.0
[edit] Seem to have worked by changing
"@aws-cdk/assert": "1.70.0"
to
"@aws-cdk/assert": "^1.70.0"
Most helpful comment
I suspect this might be a result of multiple versions of CDK modules in your
node_modules
. Can you please verify yourpackage.json
uses the same version for all CDK modules, nuke yournode_modules
and re-runnpm install
(oryarn install
)?