chore: enable playwright test extension in vscode (#13135)

* chore: enable playwright test extension in vscode

This enables using the vscode debugger in playwright tests
This commit is contained in:
Steven Masley 2024-05-02 18:14:24 -05:00 committed by GitHub
parent 699e187d55
commit 7779c0a1dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 1 deletions

View File

@ -41,6 +41,15 @@ pnpm build
pnpm playwright:test
```
To run the playwright debugger from VSCode, just launch VSCode from the nix
environment and have the extension installed.
```shell
# Optionally add '--command zsh' to choose your shell.
nix develop
code .
```
# Enterprise tests
Enterprise tests require a license key to run.

View File

@ -133,7 +133,14 @@ class CoderReporter implements Reporter {
}
}
const logLines = (chunk: string): string[] => chunk.trimEnd().split("\n");
const logLines = (chunk: string | Buffer): string[] => {
if (chunk instanceof Buffer) {
// When running in a debugger, the input to this is a Buffer instead of a string.
// Unsure why, but this prevents the `trimEnd` from throwing an error.
return [chunk.toString()];
}
return chunk.trimEnd().split("\n");
};
const exportDebugPprof = async (outputFile: string) => {
const response = await axiosInstance.get(