How to disable deprecation warnings in Ember.js?

前端 未结 6 1312
心在旅途
心在旅途 2021-01-08 01:09

I\'ve written up an application that uses Ember Data. It\'s passing all it\'s tests and running as expected, however, something is causing a repeated deprecation warning to

6条回答
  •  执念已碎
    2021-01-08 02:02

    For Ember 3.8 below code in app/initializers/deprecation.js worked for me. This disables the deprecations while running tests. You can modify according to your needs.

    import { registerDeprecationHandler } from '@ember/debug';
    import config from 'happyfox-web/config/environment';
    
    export function initialize() {
      registerDeprecationHandler((message, options, next) => {
        if (config.environment === 'test') {
          return;
        } else {
          next(message, options);
        }
      });
    }
    
    export default { initialize };
    

    Took this from the docs

提交回复
热议问题