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

chore: Remove redundant console.log #239

Merged
merged 3 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/testcafe
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env node

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

(async () => await testCafeRunner())();
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"license": "MIT",
"private": true,
"bin": "./bin/testcafe",
"main": "lib/console-wrapper.js",
"main": "lib/runner.js",
"scripts": {
"build": "tsc && cp src/sauce-testcafe-config.cjs lib/",
"test": "node lib/console-wrapper.js",
"test": "node lib/runner.js",
"lint": "prettier --check '**/*.{js,ts,mjs,cjs}' && eslint .",
"fmt": "prettier --write '**/*.{js,ts,mjs,cjs}'",
"unit-test": "jest --env node",
Expand Down
10 changes: 0 additions & 10 deletions src/console-wrapper.ts → src/runner.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env node
import fs from 'fs';
import path from 'path';
import * as stream from 'stream';
import child_process from 'child_process';
import * as utils from 'sauce-testrunner-utils';
import { TestCafeConfig } from './type';
Expand All @@ -20,12 +19,6 @@ async function testCafeRunner() {
if (!fs.existsSync(assetsPath)) {
fs.mkdirSync(assetsPath);
}
const fd = fs.openSync(path.join(assetsPath, 'console.log'), 'w+', 0o644);
const ws = new stream.Writable({
write(data: any, encoding: any, cb: any) {
fs.write(fd, data, undefined, encoding, cb);
},
});

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

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

child.on('exit', (exitCode: number) => {
fs.closeSync(fd);
if (exitCode === 0) {
resolve();
} else {
Expand Down
Loading