googleapis / googleapis/google-cloud-node

Add a way to suppress WARN for stackdriver NODE_ENV setup

Open
#7,508 8 comments 10 reactions 0 assignees View on GitHub
api: clouderrorreporting api: error-reporting priority: p3 type: feature request
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

When I run my unit tests, the stdout contains lots of the following warning:

`
WARN:@google-cloud/error-reporting: The stackdriver error reporting client is configured to report errors if and only if the NODE_ENV environment variable is set to "production". Errors will not be reported. To have errors always reported, regardless of the value of NODE_ENV, set the reportMode configuration option to "always".
`

This happens because my unit tests invoke my entire app (a koa2 app) which includes the error reporting setup.

I'd like a way to suppress this warning for testing - maybe by handling `NODE_ENV=test` or a configuration option.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.