zeyneloz / onesignal-node

A Node.js Library for OneSignal push notification service
MIT License
207 stars 48 forks source link

[feat] implements thrown error for appId and apiKey missing #50

Closed ghost closed 4 years ago

ghost commented 4 years ago

In line with the fail fast philosophy, this PR causes one signal to fail if the apiKey or appId is empty. This is useful for use cases where env vars are being pulled from a config service that might result in empty string if they are not declared.

zeyneloz commented 4 years ago

Thanks for the PR @miguelsolano . I don't see any benefit in enforcing users to give a non-empty string for the key and id. It is up to them to check the validity of the key and fail fast if they want to. Also, developers might intentionally give null/empty strings in their tests with mocked Clients.