Many "Inferno is in development mode" logs during testing

See original GitHub issue

Observed Behaviour

When running tests that utilize Inferno as part of the framework, every test will log Inferno is in development mode. to the console. This is due to the NODE_ENV !== 'production' check in index.ts within Inferno.

This logging behavior, without an ability to stop it, pollutes test logs with these statements.

Expected Current Behaviour

I don’t know if there’s an exact specified behavior. Having a way to turn off these logs (without setting the whole process to ‘production’) would be helpful.

If this is a design choice, the options as far as I can tell are to:

  • Add a new environment variable (or other setting) to disable Inferno log statements
  • Detect a variable when this log should happen - to ensure it gets run when a “real” browser is running, and not a test suite.
  • “Just deal with” extra log statements in various capacities
  • Ask users to monkey patch console.log to avoid extra logging
  • Ask users to switch test suites running to ‘production’

A few of the above are non-ideal, and I would argue switching test suite to production is just a bad idea.

Ideally, I think that an environment variable or environment detection makes the most sense.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Havunencommented, Sep 8, 2021

Okay sure, would you like to send PR?

1reaction
Havunencommented, Sep 8, 2021

what about disabling the console log then?

window.console.log = () => {}
Read more comments on GitHub >

github_iconTop Results From Across the Web

"Inferno is in development mode." log in every Test Suit
Hi,. The You are running production build of Inferno in development mode. Use dev:module entry point. warning appears because the production ...
Read more >
console.log only in development mode Angular 2
This approach is just add an extra layer of delaing with console object and you need to inject the logger service in every...
Read more >
Community Libraries - Inferno JS
An extremely fast React-like javascript library for building modern user interfaces.
Read more >
inferno - npm
By default, Inferno will run in development mode. Development mode provides extra checks and better error messages at the cost of slower ...
Read more >
Atomos Shogun Inferno – User Manual - Lensrentals.com
Monitor mode (HDR / Log / Custom Looks) ... unit manufactured by ATOMOS Shogun Inferno and purchased through ... to the production workflow...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found