@budarin/no-ops-service
v1.0.7
Published
A universal service where any called methods perform noop.
Downloads
4
Readme
no-ops-service
A universal service where any called methods perform noop.
It is convenient as a stub for services during testing or for stub services that are not needed in any environment.
Installation
yarn add @budarin/no-ops-service
Usage
import { logger } from 'some-logger';
import { noOpsService } from '@budarin/no-ops-service';
const logger = __TEST__ ? noOpsService : logger;
logger.log('hello'); // do nothing in test env and log in else
License
MIT