Skip to content

Commit 5e0fbfe

Browse files
committed
chore: Remove redundant console.log
1 parent 62ece48 commit 5e0fbfe

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

bin/testcafe

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
22

3-
const { testCafeRunner } = require('../lib/console-wrapper');
3+
const { testCafeRunner } = require('../lib/runner');
44

55
(async () => await testCafeRunner())();

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"license": "MIT",
77
"private": true,
88
"bin": "./bin/testcafe",
9-
"main": "lib/console-wrapper.js",
9+
"main": "lib/runner.js",
1010
"scripts": {
1111
"build": "tsc && cp src/sauce-testcafe-config.cjs lib/",
12-
"test": "node lib/console-wrapper.js",
12+
"test": "node lib/runner.js",
1313
"lint": "prettier --check '**/*.{js,ts,mjs,cjs}' && eslint .",
1414
"fmt": "prettier --write '**/*.{js,ts,mjs,cjs}'",
1515
"unit-test": "jest --env node",

src/console-wrapper.ts src/runner.ts

-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env node
22
import fs from 'fs';
33
import path from 'path';
4-
import * as stream from 'stream';
54
import child_process from 'child_process';
65
import * as utils from 'sauce-testrunner-utils';
76
import { TestCafeConfig } from './type';
@@ -20,12 +19,6 @@ async function testCafeRunner() {
2019
if (!fs.existsSync(assetsPath)) {
2120
fs.mkdirSync(assetsPath);
2221
}
23-
const fd = fs.openSync(path.join(assetsPath, 'console.log'), 'w+', 0o644);
24-
const ws = new stream.Writable({
25-
write(data: any, encoding: any, cb: any) {
26-
fs.write(fd, data, undefined, encoding, cb);
27-
},
28-
});
2922

3023
const [nodeBin] = process.argv;
3124
const testcafeRunnerEntry = path.join(__dirname, 'testcafe-runner.js');
@@ -36,11 +29,8 @@ async function testCafeRunner() {
3629

3730
child.stdout.pipe(process.stdout);
3831
child.stderr.pipe(process.stderr);
39-
child.stdout.pipe(ws);
40-
child.stderr.pipe(ws);
4132

4233
child.on('exit', (exitCode: number) => {
43-
fs.closeSync(fd);
4434
if (exitCode === 0) {
4535
resolve();
4636
} else {

0 commit comments

Comments
 (0)