Skip to content

Commit

Permalink
add KMSProvider tests
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Jun 13, 2024
1 parent 5a2c455 commit 66826be
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/types/client-side-encryption.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expectAssignable, expectError, expectType } from 'tsd';
import { expectAssignable, expectError, expectNotAssignable, expectType } from 'tsd';

import type {
AWSEncryptionKeyOptions,
Expand All @@ -9,6 +9,7 @@ import type {
KMSProviders,
RangeOptions
} from '../..';
import type { ClientEncryptionDataKeyProvider } from '../mongodb';

type RequiredCreateEncryptedCollectionSettings = Parameters<
ClientEncryption['createEncryptedCollection']
Expand Down Expand Up @@ -87,3 +88,18 @@ expectAssignable<RequiredCreateEncryptedCollectionSettings>({
// automatic
expectAssignable<KMSProviders['gcp']>({});
}

{
expectAssignable<ClientEncryptionDataKeyProvider>('aws');
expectAssignable<ClientEncryptionDataKeyProvider>('gcp');
expectAssignable<ClientEncryptionDataKeyProvider>('azure');
expectAssignable<ClientEncryptionDataKeyProvider>('local');
expectAssignable<ClientEncryptionDataKeyProvider>('kmip');
expectAssignable<ClientEncryptionDataKeyProvider>('aws:named');
expectAssignable<ClientEncryptionDataKeyProvider>('gcp:named');
expectAssignable<ClientEncryptionDataKeyProvider>('azure:named');
expectAssignable<ClientEncryptionDataKeyProvider>('local:named');
expectAssignable<ClientEncryptionDataKeyProvider>('kmip:named');

expectNotAssignable<ClientEncryptionDataKeyProvider>('arbitrary string');
}

0 comments on commit 66826be

Please sign in to comment.