Skip to content

Commit 474d161

Browse files
committed
fix: remove typo
1 parent a4ecefa commit 474d161

File tree

2 files changed

+26
-23
lines changed

2 files changed

+26
-23
lines changed

nightwatch-globals.js

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,45 @@
1-
const { outputBanner } = require('ci-utils');
2-
const { tmpdir } = require('os');
3-
const { join } = require('path');
4-
const { readFileSync, writeFileSync } = require('fs');
1+
// Global afterEach and reporter for all nightwatch tests
2+
// Commented out code provides the ability to collect all nightwatch results to one json file
3+
// Commented out code to be used if nightwatch results reporting needs to be consolidated in Github Checks
4+
5+
// const { outputBanner } = require('ci-utils');
6+
// const { tmpdir } = require('os');
7+
// const { join } = require('path');
8+
// const { readFileSync, writeFileSync } = require('fs');
59
const sauce = require('./scripts/nightwatch-sauce');
610

7-
const dataFilePath = join(tmpdir(), 'nightwatch-results.json');
8-
const read = () => JSON.parse(readFileSync(dataFilePath, 'utf8'));
9-
const write = data => writeFileSync(dataFilePath, JSON.stringify(data), 'utf8');
11+
// const dataFilePath = join(tmpdir(), 'nightwatch-results.json');
1012

11-
console.log({ dataFilePath });
13+
// const read = () => JSON.parse(readFileSync(dataFilePath, 'utf8'));
14+
// const write = data => writeFileSync(dataFilePath, JSON.stringify(data), 'utf8');
1215

13-
write({
14-
testCount: 0,
15-
results: [],
16-
});
16+
// console.log({ dataFilePath });
17+
18+
// write({
19+
// testCount: 0,
20+
// results: [],
21+
// });
1722

1823
const theGlobals = {
1924
testingUrl: 'https://boltdesignsystem.com',
2025
results: [],
2126
testCount: 0,
2227

2328
afterEach(browser, cb) {
24-
const data = read();
25-
data.testCount += 1;
26-
write(data);
27-
// theGlobals.testCount += 1;
28-
outputBanner(`global afterEach called, testCount at ${data.testCount}`);
29+
// const data = read();
30+
// data.testCount += 1;
31+
// write(data);
32+
// // theGlobals.testCount += 1;
33+
// outputBanner(`global afterEach called, testCount at ${data.testCount}`);
2934
sauce(browser, cb);
3035
},
3136

3237
reporter(results, cb) {
3338
// totalReports += 1;
34-
const data = read();
35-
data.results.push(results);
36-
write(data);
37-
console.log(`global reporter called; have total of ${data.results.length}`);
39+
// const data = read();
40+
// data.results.push(results);
41+
// write(data);
42+
// console.log(`global reporter called; have total of ${data.results.length}`);
3843
console.log(results);
3944
cb();
4045
},

scripts/nightwatch-sauce.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
// Tell Sauce Labs about Nightwatch fails
44

5-
const https = require('https');
65
const fetch = require('node-fetch');
76
const { outputBanner } = require('ci-utils');
87
const { setCheckRun } = require('./check-run');
@@ -170,7 +169,6 @@ module.exports = function sauce(client, callback) {
170169
headers: {
171170
'Content-Type': 'application/json',
172171
Accept: 'application/json',
173-
'Content-Length': data.length,
174172
},
175173
})
176174
.then(res => res.json())

0 commit comments

Comments
 (0)