Pergunta

I use karma to run jasmine specs. Every time a file changes the tests are run. This is awesome but it would be even better if the previous test output would be removed from the terminal.

Is there a way to clear the terminal before tests are run in karma?

Foi útil?

Solução 2

The issue @Sylvain has created is still open, but there is a plugin karma-clear-screen-reporter which does the job. Internally it uses the magic:

console.log('\u001b[2J\u001b[0;0H');

Alternatively you can also place this at the top of your test runner code to clear the console yourself.

Outras dicas

It is not supported. I like this idea though. I created issue #1004 to support this.

Context

My answer is the same as @bluenote10

The difference is that I made some improvements to the package he posted and published it on my github:

Karma Clear Screen

Improvements

  • Improvement in the initial message.
  • Date of the update.
  • In addition to console.log('\u001b[2J\u001b[0;0H'); the spacing has been improved.
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top