Universal Logging for Typescript/JavaScript
Getting Started
Reference Manual
Plugins
FAQ's
v1.x
GitHub
Getting Started
Reference Manual
Plugins
FAQ's
v1.x
GitHub
  • Reference Manual
    • Introduction & Lifecycle
    • Log Class
    • Data Getters
    • Modifiers
    • Terminators
    • Global Store
    • Tools
    • Configuration
    • Middleware
    • Formatters
    • Unit Testing

Unit Testing

When executing your unit tests you generally do not want to see the internal logging of the code you are testing; rather you only care about the inputs and outputs. To disable logs while executing your unit tests, within your unit test environment you should set the global value $ADZE_ENV = 'test'. This tells adze logs to prevent rendering for the sake of unit tests.

Example

// For all environments
globalThis.$ADZE_ENV = 'test';

URL Parameter Override

There may be a time when you are debugging in the browser and would like to set the Adze ENV without changing any code. In this case you can use the reserved ADZE_ENV URL parameter to set it.

http://my-site.com/?ADZE_ENV=test
Edit this page
Last Updated:
Contributors: Andrew Stacy
Prev
Formatters