aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
2.96k stars 556 forks source link

test(lib-dynamodb): enhance type safety #6074

Closed siddsriv closed 1 month ago

siddsriv commented 1 month ago

Issue

Internal JS-5189

Description

  1. Defines NestedList and NestedMap types to describe structure of nested arrays and objects within test data, addressing TS2322 errors.
  2. Adds an index signature to the DataType interface for addressing TS7053 errors that occurred when attempting to index objects without explicit index signatures.
  3. Explicitly types the passError parameter as any, for TS7006 errors.

Testing

 PASS  src/test/lib-dynamodb.e2e.spec.ts (31.098 s)
  DynamoDBDocument
    ✓ initializes using the static constructor
    ✓ is using a random TableName=js-sdk-dynamodb-test-1715128811-le0x (1 ms)
    ✓ describes the test table
    ✓ creates the test table if it does not exist
    .
    .
    .
    ✓ can serialize class instances as maps (1 ms)
    updateTransformFunction
      ✓ modifies all fields of an object (3 ms)

Test Suites: 1 passed, 1 total
Tests:       85 passed, 85 total
Snapshots:   0 total
Time:        31.186 s
Ran all test suites.
Done in 32.00s.

Checklist


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

github-actions[bot] commented 1 month ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.