-
Notifications
You must be signed in to change notification settings - Fork 880
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
testing-unit-ts doesn't work with current package.json dependencies #1645
Comments
@madappa-sharath, I'm unable to repro with https://github.com/pulumi/examples/tree/master/testing-unit-ts after installing fresh dependencies with
Can you try again using the latest version of |
@justinvp did not work for me. Here's the output from the latest version.
apologies for the close/re-open churn. I got confused by the option next to the comment button. |
I just tried this again and ran into a new error, but after updating {
"name": "test-unit-ts",
"devDependencies": {
"mocha": "^10.4.0",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
},
"dependencies": {
"@pulumi/aws": "^6.39.0",
"@pulumi/pulumi": "^3.119.0",
"@types/mocha": "^10.0.6",
"@types/node": "^13.1.8"
}
} ... it worked as expected after running
I've gone ahead and opened #1644 At this point, I believe this is just an issue with the example, so transferring the issue to that repo. |
I tried running the example locally with `npx mocha -r ts-node/register ec2tests.ts` and ran into an error. However, after upgrading the dependencies to the latest versions, everything works as expected. Updated the CI workflows to use the same `npx mocha ...` command we mention in https://github.com/pulumi/examples/blob/master/testing-unit-ts/mocha/README.md, and updated those to run on the current active LTS version of Node (20). Fixes #1645
What happened?
I have unit tests that test the output of components. These outputs are inputs to the constructor and not those generated by cloud providers. These tests have started failing after an upgrade to pulumi npm package. The output promises don't resolve in the newer versions of '@pulumi/pulumi' dependency.
These failures go away if I pin the version of '@pulumi/pulumi' package. These can be reproduced on the unit-testing guides in pulumi website as well. If you run the tests in https://github.com/pulumi/examples/tree/master/testing-unit-ts on a clean install, the tests will fail.
output from the example on latest version:
Expected Behavior
The promises should resolve and tests should be able to access the values.
Steps to reproduce
npm install
npx mocha -r ts-node/register ec2tests.ts
Output of
pulumi about
CLI
Version 3.72.2
Go Version go1.20.5
Go Compiler gc
Plugins
NAME VERSION
aws 5.41.0
nodejs unknown
Host
OS darwin
Version 13.4
Arch x86_64
This project is written in nodejs: executable='/Users//.nvm/versions/node/v18.14.2/bin/node' version='v18.14.2'
Backend
Name pulumi.com
URL https://app.pulumi.com/
User
Organizations
Dependencies:
NAME VERSION
mocha 9.2.2
ts-node 9.1.1
typescript 4.9.5
@pulumi/aws 5.41.0
@pulumi/pulumi 3.72.2
@types/mocha 9.1.1
@types/node 13.13.52
Additional context
These tests work fine if I pin the version of '@pulumi/pulumi' to '3.64.0' and '@pulumi/aws' to '5.36.0'. These versions are from my package-lock.json before I tried the update. Bug is in one of the versions above this.
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: