karma-runner/karma

add an option to clear console when using autoWatch:true

Open

#1004 aperta il 4 apr 2014

Vedi su GitHub
 (22 commenti) (6 reazioni) (1 assegnatario)JavaScript (1703 fork)batch import
discusshelp wantedtype: backlogtype: feature

Metriche repository

Star
 (11.918 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

This is based on http://stackoverflow.com/questions/22824255/karma-clear-screen-after-running-tests.

Simply adding this in watcher.js at line 91, makes this work (at least on windows). All that is left to do is add the options to the config and pass them to watcher.

var util = require('util');
util.print("\u001b[2J\u001b[0;0H");

Is this something we want to add? I think it's useful.

Maybe we should instead support a beforeRun script that people could use to do that instead.

A workaround is to create a clear-screen-reporter that just overrides this.onRunStart and does

this.onRunStart = function() {
   console.log("\u001b[2J\u001b[0;0H");
};

Guida contributor