Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: replace mocha junit reports with our own #275

Merged
merged 13 commits into from
Feb 20, 2024
Merged
32 changes: 30 additions & 2 deletions bin/cypress
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
#!/usr/bin/env node

const { cypressRecorder } = require('../lib/cypress-recorder');
const fs = require('fs');
const path = require('path');
const stream = require('stream');
const childProcess = require('child_process');

(async () => await cypressRecorder())();
const fd = fs.openSync(
path.join(process.cwd(), 'console.log'),
'w+',
0o644
);
const ws = new stream.Writable({
write (data, encoding, cb) {
fs.write(fd, data, undefined, encoding, cb);
}
});

const [nodeBin] = process.argv;
const child = childProcess.spawn(nodeBin, [
path.join(__dirname, 'lib', 'cypress-runner.js'),
...process.argv.slice(2)
]);

child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
child.stdout.pipe(ws);
child.stderr.pipe(ws);

child.on('exit', (exitCode) => {
fs.closeSync(fd);
process.exit(exitCode);
});
139 changes: 78 additions & 61 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"release:patch": "npm run release -- patch",
"release:minor": "npm run release -- minor",
"release:major": "npm run release -- major",
"unit-test": "jest --env node"
"unit-test": "jest --env node --passWithNoTests"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: --passWithNoTests was added because with the removal of the custom reporter spec, there are no more unit tests remaining in the project. I could remove the CI step that runs the unit tests, if folks prefer that to this change.

},
"keywords": [],
"dependencies": {
Expand All @@ -35,7 +35,8 @@
"@cypress/grep": "4.0.1",
"@cypress/webpack-preprocessor": "6.0.1",
"@cypress/xpath": "2.0.3",
"@saucelabs/cypress-plugin": "3.1.2",
"@saucelabs/cypress-junit-plugin": "0.2.0",
"@saucelabs/cypress-plugin": "3.1.3",
"@shelex/cypress-allure-plugin": "2.40.1",
"@tsconfig/node20": "20.1.2",
"babel-loader": "9.1.3",
Expand All @@ -47,7 +48,6 @@
"fluent-ffmpeg": "^2.1.2",
"lodash": "4.17.21",
"mkdirp": "^3.0.1",
"mocha-junit-reporter": "^2.2.1",
"playwright-webkit": "1.41.0",
"sauce-testrunner-utils": "2.0.0",
"typescript": "5.3.3",
Expand Down
Loading
Loading