Skip to content

Commit 2baf087

Browse files
committed
remove console.log directly
1 parent 198697c commit 2baf087

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/playwright-recorder.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
1-
import * as fs from 'node:fs';
21
import * as path from 'node:path';
32
import { Transform } from 'node:stream';
43
import * as childProcess from 'node:child_process';
54
import * as process from 'node:process';
65

76
const escapeSequenceRegex = new RegExp(
8-
// eslint-disable-next-line no-control-regex
97
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))',
108
'g',
119
);
1210

1311
export function playwrightRecorder() {
14-
const assetsPath = path.join(process.cwd(), '__assets__');
15-
if (!fs.existsSync(assetsPath)) {
16-
fs.mkdirSync(assetsPath);
17-
}
18-
const ws = fs.createWriteStream(path.join(assetsPath, 'console.log'), {
19-
flags: 'w+',
20-
mode: 0o644,
21-
});
2212
const stripAsciiTransform = new Transform({
2313
transform(chunk, _, callback) {
2414
// list reporter uses escape codes to rewrite lines, strip them to make console output more readable
@@ -34,11 +24,8 @@ export function playwrightRecorder() {
3424

3525
child.stdout.pipe(stripAsciiTransform).pipe(process.stdout);
3626
child.stderr.pipe(process.stderr);
37-
child.stdout.pipe(ws);
38-
child.stderr.pipe(ws);
3927

4028
child.on('exit', (exitCode) => {
41-
ws.end();
4229
process.exit(exitCode ?? 1);
4330
});
4431
}

0 commit comments

Comments
 (0)