Skip to content

Commit

Permalink
Fix for #1573 (#1581)
Browse files Browse the repository at this point in the history
* skipping developement mode notification in testing environment

* better environment type detection

Co-authored-by: Roman Petrov <roman.petrov@lucy-ims.com>
  • Loading branch information
igvnv and Roman Petrov authored Nov 8, 2021
1 parent ef07f26 commit 5c017e1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/inferno/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ import { createClassComponentInstance, renderFunctionalComponent } from './DOM/u
import { mount, mountClassComponentCallbacks, mountElement, mountFunctionalComponentCallbacks } from './DOM/mounting';
import { createRef, forwardRef, mountRef } from './core/refs';

if (process.env.NODE_ENV !== 'production') {
// Checks if Inferno is running in testing environment.
const testingEnv = process.env.JEST_WORKER_ID !== undefined;

// This message informs developers that they are using development mode (can happen
// in production because of bundling mistakes) and, therefore, Inferno is slower
// than in production mode. Skipping the notification for testing mode to keep testing
// console clear.
if (process.env.NODE_ENV !== 'production' && !testingEnv) {
/* tslint:disable-next-line:no-empty */
const testFunc = function testFn() {};
/* tslint:disable-next-line*/
Expand Down

0 comments on commit 5c017e1

Please sign in to comment.