<@U0238TKMK60> Does adding `--stage test` fix that...
# sst
a
@Adrián Mouly Does adding
--stage test
fix that?
a
I think I tested that before but it says invalid parameter.
a
Ah, may need the = sign:
sst test --stage=test
. See https://docs.serverless-stack.com/packages/cli#test
a
Weird.
b
Depends on how you build your units tests I guess. I tend to do something like this:
Copy code
const stack = new MyStack(new App());
App
with no config supplied will use the default values - where
stage
is
dev
. You can pass
{ stage: "whatever" }
in the the
App
constructor to set the stage.
a
Aaahm
Good point.
Thank you.
Going to try.
b
I have a utility class that I use for transforming resource names based on the stage so that's why I set up my stack tests that way - there may be a better way of doing things if you're not playing with the stage in this manner.
a
Yeah I also have some utility class.
Thank you @Brinsley, it worked doing this:
const app = new App({stage: ‘test’});