Skip to content

Commit 340802d

Browse files
njlynchmergify-bot
authored andcommitted
chore(lambda-nodejs): fix test broken in CodeBuild (#17884)
This test fails in our CodeBuild environment with the following error: ``` FAIL test/util.test.js ● extractDependencies › with file dependency expect(received).toEqual(expected) // deep equality - Expected - 1 + Received + 1 Object { - "my-module": StringMatching /aws-cdk\/packages\/@aws-cdk\/core/, + "my-module": "file:/codebuild/output/src777018412/src/packages/@aws-cdk/core", } 130 | })); 131 | > 132 | expect(extractDependencies(pkgPath, ['my-module'])).toEqual({ | ^ 133 | 'my-module': expect.stringMatching(/aws-cdk\/packages\/@aws-cdk\/core/), 134 | }); 135 | at Object.<anonymous> (test/util.test.ts:132:57) ``` This is due to the source being located in .../src instead of .../aws-cdk. Fix the test by stopping the check at the 'packages' directory. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* (cherry picked from commit d5c249f)
1 parent b3bfd66 commit 340802d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/@aws-cdk/aws-lambda-nodejs/test/util.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ describe('extractDependencies', () => {
130130
}));
131131

132132
expect(extractDependencies(pkgPath, ['my-module'])).toEqual({
133-
'my-module': expect.stringMatching(/aws-cdk\/packages\/@aws-cdk\/core/),
133+
'my-module': expect.stringMatching(/packages\/@aws-cdk\/core/),
134134
});
135135

136136
fs.unlinkSync(pkgPath);

0 commit comments

Comments
 (0)