I can no longer run `yarn test`. I get: ```Look li...
# help
s
I can no longer run
yarn test
. I get:
Copy code
Look like you're running sst for the first time in this directory. Please enter a stage name you'd like to use locally. Or hit enter to use the one based on your AWS credentials (samh):
but if I run
yarn test --stage dev
(which usually fixes the above error), it says:
Copy code
● Unrecognized CLI Parameter:

  Unrecognized option "stage".

  CLI Options Documentation:
  <https://jestjs.io/docs/en/cli.html>
not sure how to get around this one
f
@Sam Hulick are you getting this on ur local or in CI?
s
locally. I decided to run it to see, since my GitHub Action has been failing lately
hm.. maybe the GitHub Action failure is unrelated though
f
Do you have a default stage configured on ur local?
^^ GH action is likely failing due to the same reason
s
I thought you couldn’t do that anymore? I had a warning from SST that putting
stage
in sst.json was deprecated
so I removed it
now
--stage
is required for everything I run
actually, sorry.. I was wrong 😐 GitHub Action is totally fine.
though local testing still won’t work
f
Now SST prompts u to for a default stage name when
--stage
is not passed in
and it will be saved inside
.sst
s
ahh!
f
This was meant to solve the problem everyone on the team not all using the same stage in
sst.json
So each person uses a unique stage name
But if you have been using
dev
before, you can just enter
dev
when you are prompted
And then you shouldn’t see the prompt again
s
I think that worked.
yarn test
is now running.. taking a long time though. but it seems the stage thing is fixed, thanks! 🙂
whew..
yarn test
took slightly over 2 minutes to complete 🤔
for a single, small file! that itself took 11 seconds
f
hmm.. is running
npx jest
directly faster?
s
worse. I run it and it it hangs.. no output to the console at all
lemme try
DEBUG=* yarn test
ugh. my project’s dependencies are hosed again, after updating SST. this happened last time I did it (I told @thdxr about it). the AWS CDK packages are mismatched somehow
Copy code
Updating @aws-cdk/aws-apigatewayv2@1.125.0
Updating @aws-cdk/aws-apigatewayv2-authorizers@1.125.0
and yet in package.json:
Copy code
"@aws-cdk/aws-apigatewayv2": "1.124.0",
    "@aws-cdk/aws-apigatewayv2-authorizers": "1.124.0",
t
This is an issue with yarn2
I'm starting work on supporting yarn2 properly alongside pnpm today
s
ah yeah, I remember now. how did we resolve this last time? 🤔
cool. but this isn’t PnP mode though.. regular node-modules nodeLinker setting
could I just update the CDK packages manually to 1.125.0?
t
yeah you can
The issue is right now we do
yarn add @package/whatever -W
in yarn2
-W
isn't a thing
But required for yarn1
s
ok, my jest test ran much faster now, after updating SST
strange
t
I'll take credit for that 👀