Для полноты вот полная конфигурация:
Прежде всего выполните команду npm install
:
npm install jasmine-console-reporter --save-dev
Затем проверьте свою конфигурацию Jasmine, чтобы убедиться, что у вас там есть помощники:
spec/support/jasmine.json
{
"spec_dir": "spec",
"spec_files": [
"**/*[sS]pec.js"
],
"helpers": [
"helpers/**/*.js"
],
"stopSpecOnExpectationFailure": false,
"random": false
}
Поскольку помощники выполняются перед спецификациями, единственное, что вам нужно сделать, - это создать вспомогательный помощник-репортер.
spec/helpers/reporter/consoleReporter.js
const JasmineConsoleReporter = require('jasmine-console-reporter');
let consoleReporter = new JasmineConsoleReporter({
colors: 1, // (0|false)|(1|true)|2
cleanStack: 1, // (0|false)|(1|true)|2|3
verbosity: 4, // (0|false)|1|2|(3|true)|4
listStyle: 'indent', // "flat"|"indent"
activity: false
});
jasmine.getEnv().addReporter(consoleReporter);