Skip to content

Commit

Permalink
feat: replace mocha junit reports with our own (#275)
Browse files Browse the repository at this point in the history
* feat: replace mocha junit reports with our own

* fix: stop passing around wrong types

* deps: bump @saucelabs/cypress-plugin@3.1.3

* allow report generation on failure

* refactor: remove obsolete reporter

* refactor: remove unused exports

* refactor: remove unnecessary wrapper

* build: allow jest to pass without tests

* deps: remove obsolete mocha-junit-reporter
  • Loading branch information
alexplischke authored Feb 20, 2024
1 parent f33c7f1 commit c18532b
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 1,110 deletions.
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"
},
"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

0 comments on commit c18532b

Please sign in to comment.