From 5a30af5f7ee0474697aa3fe838c087dbed07a18b Mon Sep 17 00:00:00 2001 From: go-to-k <24818752+go-to-k@users.noreply.github.com> Date: Mon, 5 Feb 2024 20:42:46 +0900 Subject: [PATCH] add unit test add an unit test --- .../sage-maker-start-pipeline-execution.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/sage-maker-start-pipeline-execution.test.ts b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/sage-maker-start-pipeline-execution.test.ts index 4c45d04462281..e48c3754d7e6f 100644 --- a/packages/@aws-cdk/aws-scheduler-targets-alpha/test/sage-maker-start-pipeline-execution.test.ts +++ b/packages/@aws-cdk/aws-scheduler-targets-alpha/test/sage-maker-start-pipeline-execution.test.ts @@ -736,4 +736,20 @@ describe('schedule target', () => { target: pipelineTarget, })).toThrow(/Number of retry attempts should be less or equal than 185/); }); + + test('throws when pipelineParameterList length is greater than 200', () => { + const dummyObject = { + name: 'MyParameterName', + value: 'MyParameterValue', + }; + const dummyPipelineParameterList: SageMakerPipelineParameter[] = []; + for (let i = 0; i < 201; i++) { + dummyPipelineParameterList.push(dummyObject); + } + + expect(() => + new SageMakerStartPipelineExecution(pipeline, { + pipelineParameterList: dummyPipelineParameterList, + })).toThrow(/pipelineParameterList length must be between 0 and 200, got 201/); + }); }); \ No newline at end of file