문제

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?

도움이 되었습니까?

해결책 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.

다른 팁

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.
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top