From ddc3b552d7cab4e0cdd79333a016989081651b13 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Fri, 13 May 2022 12:51:02 +0200 Subject: [PATCH] jasmine reporters are now added using addReporter --- back/tests.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/back/tests.js b/back/tests.js index 335688778..809906177 100644 --- a/back/tests.js +++ b/back/tests.js @@ -27,8 +27,11 @@ async function test() { const app = require('vn-loopback/server/server'); app.boot(bootOptions); + const Jasmine = require('jasmine'); + const jasmine = new Jasmine(); + const SpecReporter = require('jasmine-spec-reporter').SpecReporter; - const specReporter = new SpecReporter({ + jasmine.addReporter(new SpecReporter({ spec: { displaySuccessful: isCI, displayPending: isCI @@ -36,23 +39,15 @@ async function test() { summary: { displayPending: false, } - }); - - const reporters = [specReporter]; + })); if (isCI) { const JunitReporter = require('jasmine-reporters'); - const junitReporter = new JunitReporter.JUnitXmlReporter(); - reporters.push(junitReporter); + jasmine.addReporter(new JunitReporter.JUnitXmlReporter()); + + jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000; } - const Jasmine = require('jasmine'); - const jasmine = new Jasmine({ - reporter: reporters - }); - - if (isCI) jasmine.jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000; - const backSpecs = [ './back/**/*[sS]pec.js', './loopback/**/*[sS]pec.js',