Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade jest to ^29 #25113

Merged
merged 10 commits into from
Apr 14, 2023
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ concurrency=$(node -p 'Math.max(1, require("os").cpus().length - 1)')
flags=""
if [ "$ci" == "true" ]; then
flags="--stream --no-progress --skip-nx-cache"
export FORCE_COLOR=false
fi

echo "============================================================================================="
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk-testing/cli-integ/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"axios": "^0.27.2",
"fs-extra": "^9.1.0",
"glob": "^7.2.3",
"jest": "^27.5.1",
"jest": "^29.5.0",
"jest-junit": "^14.0.1",
"make-runnable": "^1.4.1",
"npm": "^8.19.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-amplify-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.0",
"aws-sdk": "^2.1329.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigatewayv2-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.111",
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/aws-apigatewayv2-integrations-alpha": "0.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apprunner-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"aws-cdk-lib": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-batch-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"jest": "^27.5.1",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ import { ArnPrincipal, Role } from 'aws-cdk-lib/aws-iam';
import * as logs from 'aws-cdk-lib/aws-logs';
import { Secret } from 'aws-cdk-lib/aws-secretsmanager';
import { Size, Stack } from 'aws-cdk-lib';
import { capitalizePropertyNames } from 'aws-cdk-lib/core/lib/util';
import { EcsContainerDefinitionProps, EcsEc2ContainerDefinition, EcsFargateContainerDefinition, EcsJobDefinition, EcsVolume, IEcsEc2ContainerDefinition, LinuxParameters, UlimitName } from '../lib';
import { CfnJobDefinitionProps } from 'aws-cdk-lib/aws-batch';

import { capitalizePropertyNames } from './utils';

// GIVEN
const defaultContainerProps: EcsContainerDefinitionProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Template } from 'aws-cdk-lib/assertions';
import * as ecs from 'aws-cdk-lib/aws-ecs';
import { Size, Stack } from 'aws-cdk-lib';
import { capitalizePropertyNames } from 'aws-cdk-lib/core/lib/util';
import { capitalizePropertyNames } from './utils';
import { EksContainerDefinitionProps, EksContainerDefinition, EksJobDefinition, ImagePullPolicy, EksVolume, EmptyDirMediumType } from '../lib';
import { CfnJobDefinitionProps } from 'aws-cdk-lib/aws-batch';

Expand Down Expand Up @@ -681,4 +681,4 @@ describe('eks container', () => {
},
});
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Template } from 'aws-cdk-lib/assertions';
import { InstanceClass, InstanceSize, InstanceType } from 'aws-cdk-lib/aws-ec2';
import * as ecs from 'aws-cdk-lib/aws-ecs';
import { /*Aws,*/ Duration, Size, Stack } from 'aws-cdk-lib';
import { capitalizePropertyNames } from 'aws-cdk-lib/core/lib/util';
import { capitalizePropertyNames } from './utils';
import * as batch from '../lib';
import { CfnJobDefinitionProps } from 'aws-cdk-lib/aws-batch';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as eks from 'aws-cdk-lib/aws-eks';
import { ArnPrincipal, Role, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
import { Stack, Duration } from 'aws-cdk-lib';
import { capitalizePropertyNames } from 'aws-cdk-lib/core/lib/util';
import { capitalizePropertyNames } from './utils';
import * as batch from '../lib';
import { AllocationStrategy, ManagedEc2EcsComputeEnvironment, ManagedEc2EcsComputeEnvironmentProps, ManagedEc2EksComputeEnvironment, ManagedEc2EksComputeEnvironmentProps } from '../lib';
import { CfnComputeEnvironmentProps } from 'aws-cdk-lib/aws-batch';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Template } from 'aws-cdk-lib/assertions';
import { Role, ServicePrincipal } from 'aws-cdk-lib/aws-iam';
import { Stack } from 'aws-cdk-lib/core';
import { capitalizePropertyNames } from 'aws-cdk-lib/core/lib/util';
import { capitalizePropertyNames } from './utils';
import { CfnComputeEnvironmentProps } from 'aws-cdk-lib/aws-batch';
import { UnmanagedComputeEnvironment } from '../lib/unmanaged-compute-environment';

Expand Down
30 changes: 30 additions & 0 deletions packages/@aws-cdk/aws-batch-alpha/test/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Stack } from 'aws-cdk-lib';
import { IConstruct } from 'constructs';

/**
* Given an object, converts all keys to PascalCase given they are currently in camel case.
* @param obj The object.
*/
export function capitalizePropertyNames(construct: IConstruct, obj: any): any {
const stack = Stack.of(construct);
obj = stack.resolve(obj);

if (typeof(obj) !== 'object') {
return obj;
}

if (Array.isArray(obj)) {
return obj.map(x => capitalizePropertyNames(construct, x));
}

const newObj: any = { };
for (const key of Object.keys(obj)) {
const value = obj[key];

const first = key.charAt(0).toUpperCase();
const newKey = first + key.slice(1);
newObj[newKey] = capitalizePropertyNames(construct, value);
}

return newObj;
}
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloud9-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codestar-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-cognito-identitypool-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"jest": "^27.5.1",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-gamelift-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"jest": "^27.5.1",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-glue-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"jest": "^27.5.1",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-iot-actions-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"jest": "^27.5.1",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"constructs": "^10.0.0",
"aws-cdk-lib": "0.0.0",
"@aws-cdk/aws-kinesisfirehose-destinations-alpha": "0.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-iot-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"jest": "^27.5.1",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-iotevents-actions-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"jest": "^27.5.1",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-iotevents-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"jest": "^27.5.1",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-ivs-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"jest": "^27.5.1",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-kinesisfirehose-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"jest": "^27.5.1",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/aws-kinesisfirehose-alpha": "0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-go-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-python-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-location-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-msk-alpha/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@
"@aws-cdk/integ-runner": "0.0.0",
"@aws-cdk/cfn2ts": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"jest": "^27.5.1",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"aws-cdk-lib": "0.0.0",
"constructs": "^10.0.0",
"@aws-cdk/integ-tests-alpha": "0.0.0"
Expand Down
Loading