Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ packageJson.addOverride("lint-staged", {
project.compileTask.prependExec(
"yarn link && cd ./test-app && yarn link functionless"
);
project.compileTask.env("NODE_OPTIONS", "--max-old-space-size=8192");
project.compileTask.env("NODE_OPTIONS", "--max-old-space-size=4096");
project.compileTask.prependExec("ts-node ./scripts/sdk-gen.ts");

project.testTask.prependExec(
Expand All @@ -224,7 +224,7 @@ project.testTask.prependExec(
project.testTask.prependExec("./scripts/localstack");
project.testTask.exec("localstack stop");

project.testTask.env("NODE_OPTIONS", "--max-old-space-size=8192");
project.testTask.env("NODE_OPTIONS", "--max-old-space-size=4096");
project.testTask.env("DEFAULT_REGION", "ap-northeast-1");
project.testTask.env("AWS_ACCOUNT_ID", "000000000000");
project.testTask.env("AWS_ACCESS_KEY_ID", "test");
Expand Down
4 changes: 2 additions & 2 deletions src/step-function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1579,9 +1579,9 @@ function getStepFunctionArgs<
| [func: StepFunctionClosure<Payload, Out>]
) {
const props =
isFunctionLike(args[0]) || isErr(args[0])
isFunctionLike(args[0]) || isErr(args[0]) || typeof args[0] === "function"
? {}
: (args[1] as StepFunctionProps);
: args[0];
Comment on lines +1582 to +1584
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What case is this catching? When would this be a function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the actual change was changing the index from 1 to 0, the function check narrows the types it comes in as without using as, it will actually be expressions, but the type on it is a function.

const func = validateFunctionLike(
args.length > 1 ? args[1] : args[0],
"StepFunction"
Expand Down
25 changes: 25 additions & 0 deletions test/__snapshots__/step-function.localstack.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions test/step-function.localstack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,21 @@ localstackTestSuite("sfnStack", (testResource, _stack, _app) => {
"hello world"
);

test(
"step function props are passed through to the resource",
(parent) => {
return new StepFunction(
parent,
"sfn2",
{ stateMachineName: "magicMachine" },
async (_, context) => {
return context.StateMachine.Name;
}
);
},
"magicMachine"
);

test(
"duplicate nodes",
(parent) => {
Expand Down