Skip to content

Commit

Permalink
fix: reading settings from reporter throwed error
Browse files Browse the repository at this point in the history
  • Loading branch information
tnicola committed Dec 24, 2021
1 parent 802fa6c commit 0043dda
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const colors = require('colors/safe');
const path = require('path');
const fs = require('fs-extra');

const { settings } = require('./settings');
const { getTestSuitePaths, distributeTestsByWeight } = require('./test-suites');
const {
formatTime,
Expand Down
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cypress-parallel",
"version": "0.8.0",
"version": "0.8.1",
"description": "Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.",
"main": "cli.js",
"repository": {
Expand Down
2 changes: 2 additions & 0 deletions lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ const settings = {
scriptArguments: argv.args ? argv.args.split(' ') : []
};

process.env.CY_PARALLEL_SETTINGS = JSON.stringify(settings);

module.exports = {
settings,
COLORS
Expand Down
6 changes: 3 additions & 3 deletions lib/simple-spec.reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
var Base = require('mocha/lib/reporters/base');
var constants = require('mocha/lib/runner').constants;

const { settings } = require('./settings');
const settings = JSON.parse(process.env.CY_PARALLEL_SETTINGS);

const {
EVENT_TEST_PENDING,
Expand Down Expand Up @@ -70,8 +70,8 @@ function JSONStreamCustom(runner, options) {
})
} else {
consoleLog(format, getTestDescription(test));
}
});
}
});

runner.on(EVENT_TEST_PASS, function (test) {
const format =
Expand Down
1 change: 0 additions & 1 deletion lib/test-suites.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const path = require('path');
const glob = require('glob');

const { settings } = require('./settings');
const { errorMonitor } = require('events');

const getFilePathsByPath = (dir) =>
fs.readdirSync(dir).reduce((files, file) => {
Expand Down

0 comments on commit 0043dda

Please sign in to comment.