googleapis / nodejs-kms

This repository is deprecated. All of its content and history has been moved to googleapis/google-cloud-node.
https://cloud.google.com/kms/
Apache License 2.0
57 stars 25 forks source link

What's the best/recommended way of using this library in a test scenario? #571

Closed jamesmorgan closed 2 years ago

jamesmorgan commented 2 years ago

Hi KMS library maintainers,

I am implementing a service which will leverage google KMS to encrypt/decrypt some data within a Google firestore project.

Is there a recommended way to using this library in a test scenario?

Any insights would be good.

Cheers

danielbankhead commented 2 years ago

Hey @jamesmorgan, I would recommend sinon for unit tests and using the library as-is for integration tests (with a proper clean-up at the end of the test suite).

Here's some useful documentation for stubbing with sinon: