serverless-dynamodb-autoscaling
Version:
Serverless Plugin for Amazon DynamoDB Auto Scaling.
32 lines (25 loc) • 754 B
text/typescript
import Role from '../../src/aws/role'
describe('Role', () => {
it('creates CF resource', () => {
const r = new Role({
index: 'index',
region: 'region',
service: 'service',
stage: 'stage',
table: 'MyTableResource'
})
const j = r.toJSON()
expect(j).toHaveProperty('serviceDynamoDBAutoscaleRoleMyTableResourceIndexStageRegion')
})
it('truncates role name if needed', () => {
const r = new Role({
index: 'index',
region: 'region',
service: 'service-with-a-long-name-to-force-truncation',
stage: 'stage',
table: 'MyTableResource'
})
const j = r.toJSON()
expect(j).toHaveProperty('servicewithalongnametoforcetrunc81d5364e64588e2b095c450722c20a24')
})
})