mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: pass color through in web server commands (#24619)
This commit is contained in:
parent
120de62798
commit
414a4c3ef0
6
package-lock.json
generated
6
package-lock.json
generated
@ -6563,7 +6563,8 @@
|
|||||||
},
|
},
|
||||||
"packages/playwright-grid": {
|
"packages/playwright-grid": {
|
||||||
"name": "@playwright/experimental-grid",
|
"name": "@playwright/experimental-grid",
|
||||||
"version": "1.37.0-next",
|
"version": "0.0.1",
|
||||||
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"commander": "^11.0.0",
|
"commander": "^11.0.0",
|
||||||
"debug": "^4.3.2",
|
"debug": "^4.3.2",
|
||||||
@ -6577,6 +6578,9 @@
|
|||||||
"@types/debug": "^4.1.8",
|
"@types/debug": "^4.1.8",
|
||||||
"@types/ws": "^8.5.5",
|
"@types/ws": "^8.5.5",
|
||||||
"playwright-core": "1.37.0-next"
|
"playwright-core": "1.37.0-next"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"packages/playwright-grid/node_modules/commander": {
|
"packages/playwright-grid/node_modules/commander": {
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import net from 'net';
|
import net from 'net';
|
||||||
|
|
||||||
import { debug } from 'playwright-core/lib/utilsBundle';
|
import { colors, debug } from 'playwright-core/lib/utilsBundle';
|
||||||
import { raceAgainstDeadline, launchProcess, httpRequest, monotonicTime } from 'playwright-core/lib/utils';
|
import { raceAgainstDeadline, launchProcess, httpRequest, monotonicTime } from 'playwright-core/lib/utils';
|
||||||
|
|
||||||
import type { FullConfig } from '../../types/testReporter';
|
import type { FullConfig } from '../../types/testReporter';
|
||||||
@ -40,6 +40,8 @@ export type WebServerPluginOptions = {
|
|||||||
|
|
||||||
const DEFAULT_ENVIRONMENT_VARIABLES = {
|
const DEFAULT_ENVIRONMENT_VARIABLES = {
|
||||||
'BROWSER': 'none', // Disable that create-react-app will open the page in the browser
|
'BROWSER': 'none', // Disable that create-react-app will open the page in the browser
|
||||||
|
'FORCE_COLOR': '1',
|
||||||
|
'DEBUG_COLORS': '1',
|
||||||
};
|
};
|
||||||
|
|
||||||
const debugWebServer = debug('pw:webserver');
|
const debugWebServer = debug('pw:webserver');
|
||||||
@ -112,11 +114,12 @@ export class WebServerPlugin implements TestRunnerPlugin {
|
|||||||
|
|
||||||
launchedProcess.stderr!.on('data', line => {
|
launchedProcess.stderr!.on('data', line => {
|
||||||
if (debugWebServer.enabled || (this._options.stderr === 'pipe' || !this._options.stderr))
|
if (debugWebServer.enabled || (this._options.stderr === 'pipe' || !this._options.stderr))
|
||||||
this._reporter!.onStdErr?.('[WebServer] ' + line.toString());
|
this._reporter!.onStdErr?.(colors.dim('[WebServer] ') + line.toString());
|
||||||
});
|
});
|
||||||
launchedProcess.stdout!.on('data', line => {
|
launchedProcess.stdout!.on('data', line => {
|
||||||
|
process.stdout.write(line);
|
||||||
if (debugWebServer.enabled || this._options.stdout === 'pipe')
|
if (debugWebServer.enabled || this._options.stdout === 'pipe')
|
||||||
this._reporter!.onStdOut?.('[WebServer] ' + line.toString());
|
this._reporter!.onStdOut?.(colors.dim('[WebServer] ') + line.toString());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user