Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Commit db7495f

Browse files
committed
address PR comments
1 parent 6b25eee commit db7495f

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

lib/frameworks/jasmine.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RunnerReporter.prototype.specStarted = function() {
1515
};
1616

1717
RunnerReporter.prototype.specDone = function(result) {
18-
let specInfo = {
18+
const specInfo = {
1919
name: result.description,
2020
category: result.fullName.slice(0, -result.description.length).trim()
2121
};
@@ -26,7 +26,7 @@ RunnerReporter.prototype.specDone = function(result) {
2626
this.failedCount++;
2727
}
2828

29-
let entry = {
29+
const entry = {
3030
description: result.fullName,
3131
assertions: [],
3232
duration: new Date().getTime() - this.startTime.getTime()
@@ -57,16 +57,16 @@ RunnerReporter.prototype.specDone = function(result) {
5757
*/
5858
exports.run = async function(runner, specs) {
5959
const JasmineRunner = require('jasmine');
60-
let jrunner = new JasmineRunner();
60+
const jrunner = new JasmineRunner();
6161

62-
let jasmineNodeOpts = runner.getConfig().jasmineNodeOpts;
62+
const jasmineNodeOpts = runner.getConfig().jasmineNodeOpts;
6363

6464
// On timeout, the flow should be reset. This will prevent webdriver tasks
6565
// from overflowing into the next test and causing it to fail or timeout
6666
// as well. This is done in the reporter instead of an afterEach block
6767
// to ensure that it runs after any afterEach() blocks with webdriver tasks
6868
// get to complete first.
69-
let reporter = new RunnerReporter(runner);
69+
const reporter = new RunnerReporter(runner);
7070
jasmine.getEnv().addReporter(reporter);
7171

7272
// Add hooks for afterEach
@@ -100,7 +100,7 @@ exports.run = async function(runner, specs) {
100100
jasmine.DEFAULT_TIMEOUT_INTERVAL = jasmineNodeOpts.defaultTimeoutInterval;
101101
}
102102

103-
let originalOnComplete = runner.getConfig().onComplete;
103+
const originalOnComplete = runner.getConfig().onComplete;
104104

105105
jrunner.onComplete(async(passed) => {
106106
try {

lib/frameworks/mocha.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
exports.run = (runner, specs) => {
99
const Mocha = require('mocha');
10-
let mocha = new Mocha(runner.getConfig().mochaOpts);
10+
const mocha = new Mocha(runner.getConfig().mochaOpts);
1111

1212
// Add hooks for afterEach
1313
require('./setupAfterEach').setup(runner, specs);
@@ -130,4 +130,4 @@ exports.run = (runner, specs) => {
130130
reject(err);
131131
}
132132
});
133-
};
133+
};

spec/driverProviderTest.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ testDriverProvider(new Direct(chromeConfig)).
4848
then(() => {
4949
console.log('direct.dp with chrome working!');
5050
}, (err) => {
51-
console.log('direct.dp with chrome failed with', err);
51+
console.error('direct.dp with chrome failed with', err);
52+
throw err;
5253
});
5354

5455
const firefoxConfig = {
@@ -60,7 +61,8 @@ testDriverProvider(new Direct(firefoxConfig)).
6061
then(() => {
6162
console.log('direct.dp with firefox working!');
6263
}, (err) => {
63-
console.log('direct.dp with firefox failed with', err);
64+
console.error('direct.dp with firefox failed with', err);
65+
throw err;
6466
});
6567

6668
const hostedConfig = {
@@ -73,7 +75,8 @@ testDriverProvider(new Hosted(hostedConfig)).
7375
then(() => {
7476
console.log('hosted.dp working!');
7577
}, (err) => {
76-
console.log('hosted.dp failed with', err);
78+
console.error('hosted.dp failed with', err);
79+
throw err;
7780
});
7881

7982
const hostedPromisedConfig = {
@@ -86,7 +89,8 @@ testDriverProvider(new Hosted(hostedPromisedConfig)).
8689
then(() => {
8790
console.log('hosted.dp with promises working!');
8891
}, (err) => {
89-
console.log('hosted.dp with promises failed with', err);
92+
console.error('hosted.dp with promises failed with', err);
93+
throw err;
9094
});
9195

9296
const localConfig = {
@@ -99,7 +103,8 @@ testDriverProvider(new Local(localConfig)).
99103
then(() => {
100104
console.log('local.dp working!');
101105
}, (err) => {
102-
console.log('local.dp failed with', err);
106+
console.error('local.dp failed with', err);
107+
throw err;
103108
});
104109

105110
if (argv.sauceUser && argv.sauceKey) {
@@ -115,7 +120,8 @@ if (argv.sauceUser && argv.sauceKey) {
115120
then(() => {
116121
console.log('sauce.dp working!');
117122
}, (err) => {
118-
console.log('sauce.dp failed with', err);
123+
console.error('sauce.dp failed with', err);
124+
throw err;
119125
});
120126
}
121127

@@ -133,6 +139,7 @@ if (argv.browserstackUser && argv.browserstackKey) {
133139
then(() => {
134140
console.log('browserstack.dp working!');
135141
}, (err) => {
136-
console.log('browserstack.dp failed with', err);
142+
console.error('browserstack.dp failed with', err);
143+
throw err;
137144
});
138-
}
145+
}

0 commit comments

Comments
 (0)