How to disable warnings when running tests

Is there a way to disable/silent the warnings outputs when running the tests? I tried to run them with

ember t --silent

but still got the warnings from ember-simple-auth (Ember Simple Auth: 'authorize' is deprecated).

Any ideas? Thank you.

Good question. I would think --silent should suppress any deprecation notice emitted by addons within your project. If that is the correct expectation, than this may be a bug to file / find. As a workaround, you could try piping the debug output to stderr:

ember t --silent 2>/dev/null 

This requires a UNIX like system. Refreshed my understanding of the cryptic pipes with this askubuntu answer.

1 Like

Thank you very much for the response. I tried to run as you suggested (I’m on macOS 10.14.5):

ember t --silent 2>/dev/null 

but it still displayed all the warnings from ESA as above.

Interesting. It could be that those deprecation notices do not get printed to the standard error stream or my untested snippet is broken :slight_smile: . What version of ember-simple-auth are you using? Also, can you share the project link?

Another question: is that deprecation notice coming from the test suite itself or being printed to your console while ember build builds your test suite?

I’m using 1.8.1 version ember-simple-auth. It seems like the warnings come from the test suite, - see the gist I created to display it. Unfortunately, the project is in a private repo and I can’t share it.

Thanks! Piping the standard error stream emitted from ember test would only remove output like the first couple lines. The --silent flag should suppress deprecation notices from ember-cli itself. I found an old issue that has an example when that was not the case. It seems like in your case, you want to silence the deprecations emitted from within the test suite. For any deprecation notices within your test suite (e.g. the NAME_KEY one), you will need to install and configure ember-cli-deprecation-workflow. Additionally, you could try the --reporter dot flag to print more concise output:

ember test --silent --reporter dot

Thank you very much, I didn’t know about --reporter dot option, it looks prettier now

No warnings at all and the output looks like an RSpec’s one :).

1 Like