Skip to content

Commit 09f2034

Browse files
committed
feat: removed jasmine-terminal-reporter dependency
Signed-off-by: Mihail Penchev (c) <[email protected]>
1 parent 5453964 commit 09f2034

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

typescript/vropkg/Gulpfile.ts

+9-12
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import * as path from 'path';
55
import { execSync } from "child_process";
66
import PluginError from "plugin-error";
77
import through from "through2";
8-
import Reporter from "jasmine-terminal-reporter";
98

109
/** Recursively delete cache for object with given ID and its children */
1110
function deleteRequireCache(id) {
@@ -28,13 +27,15 @@ function deleteRequireCache(id) {
2827
function gulpJasmineFixed() {
2928
const Jasmine = require("jasmine");
3029
const jasmineRunner = new Jasmine();
30+
jasmineRunner.exitOnCompletion = false;
3131
if (jasmineRunner.env.clearReporters) {
3232
jasmineRunner.env.clearReporters();
3333
}
34-
jasmineRunner.addReporter(new Reporter({
35-
isVerbose: true,
36-
showColors: process.argv.indexOf('--no-color') === -1,
37-
includeStackTrace: true
34+
const jasmineReporters = require("jasmine-reporters");
35+
jasmineRunner.addReporter(new jasmineReporters.TerminalReporter({
36+
verbosity: 3,
37+
color: process.argv.indexOf('--no-color') === -1,
38+
showStack: true
3839
}));
3940

4041
return through.obj((file, enc, cb) => {
@@ -44,7 +45,7 @@ function gulpJasmineFixed() {
4445
}
4546

4647
if (file.isStream()) {
47-
cb(new PluginError('gulp-jasmine', 'Streaming not supported'));
48+
cb(new PluginError('vropkg-gulpfile', 'Streaming not supported'));
4849
return;
4950
}
5051
const resolvedPath = path.resolve(file.path);
@@ -66,8 +67,6 @@ function gulpJasmineFixed() {
6667
}
6768
}
6869

69-
jasmineRunner.exitOnCompletion = false;
70-
7170
const result: Promise<any> = jasmineRunner.execute();
7271
result.then(result => {
7372
if (result.overallStatus === 'passed') {
@@ -76,13 +75,11 @@ function gulpJasmineFixed() {
7675
cb();
7776
} else {
7877
console.log('At least one spec has failed');
79-
cb(new PluginError('gulp-jasmine', 'Tests failed', {
80-
showStack: false
81-
}));
78+
cb(new PluginError('vropkg-gulpfile', 'Tests failed', { showStack: false }));
8279
}
8380
})
8481
} catch (err) {
85-
cb(new PluginError('gulp-jasmine', err, { showStack: true }));
82+
cb(new PluginError('vropkg-gulpfile', err, { showStack: true }));
8683
}
8784
});
8885
};

0 commit comments

Comments
 (0)