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

Try to handle Invalid arguments: should be exactly one string #70

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vscode/test-web",
"version": "0.0.37",
"version": "0.0.38",
"scripts": {
"install-extensions": "yarn --cwd=fs-provider && yarn --cwd=sample",
"compile": "tsc -p ./ && yarn compile-fs-provider",
Expand Down Expand Up @@ -30,7 +30,7 @@
"koa-mount": "^4.0.0",
"koa-static": "^5.0.0",
"minimist": "^1.2.8",
"playwright": "^1.32.1",
"playwright": "^1.32.2",
"vscode-uri": "^3.0.7",
"http-proxy-agent": "^5.0.0",
"https-proxy-agent": "^5.0.1",
Expand All @@ -51,7 +51,7 @@
"@types/decompress": "^4.2.4",
"eslint": "^8.37.0",
"eslint-plugin-header": "^3.1.1",
"typescript": "^5.0.2"
"typescript": "^5.0.3"
},
"license": "MIT",
"author": "Visual Studio Code Team",
Expand Down
15 changes: 13 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,15 @@ export async function runTests(options: Options & { extensionTestsPath: string }
const context = await openBrowser(endpoint, options);
if (context) {
context.once('close', () => server.close());
await context.exposeFunction('codeAutomationLog', (type: 'warn' | 'error' | 'info', args: unknown[]) => {
console[type](...args);

type Severity = 'error' | 'warning' | 'info';
const unreportedOutput: { type: Severity, args: unknown[] }[] = [];
await context.exposeFunction('codeAutomationLog', (type: Severity, args: unknown[]) => {
try {
console[type](...args);
} catch (_e) {
unreportedOutput.push({ type, args });
}
});

await context.exposeFunction('codeAutomationExit', async (code: number) => {
Expand All @@ -197,6 +204,10 @@ export async function runTests(options: Options & { extensionTestsPath: string }
} catch (error) {
console.error(`Error when closing browser: ${error}`);
}
if (unreportedOutput.length) {
console.error(`There were ${unreportedOutput.length} messages that could not be reported to the console:`);
unreportedOutput.forEach(({ type, args }) => console[type](...args));
}
server.close();
if (code === 0) {
s();
Expand Down
26 changes: 13 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1580,17 +1580,17 @@ pinkie@^2.0.0:
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA=

[email protected].1:
version "1.32.1"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.32.1.tgz#5a10c32403323b07d75ea428ebeed866a80b76a1"
integrity sha512-KZYUQC10mXD2Am1rGlidaalNGYk3LU1vZqqNk0gT4XPty1jOqgup8KDP8l2CUlqoNKhXM5IfGjWgW37xvGllBA==
[email protected].2:
version "1.32.2"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.32.2.tgz#608810c3c4486fb86a224732ac0d3560a96ded8b"
integrity sha512-zD7aonO+07kOTthsrCR3YCVnDcqSHIJpdFUtZEMOb6//1Rc7/6mZDRdw+nlzcQiQltOOsiqI3rrSyn/SlyjnJQ==

playwright@^1.32.1:
version "1.32.1"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.32.1.tgz#c48195850740fbdbd7702f37e5a891b13259f689"
integrity sha512-GnEizysWMvoqHC3I9l8+4/ZxeLwLNdJJG76xdKGxzOcIZDcw5RSk/FKrFb5CuA+zcLpjIM2p9eR9Z4CuUDkWXg==
playwright@^1.32.2:
version "1.32.2"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.32.2.tgz#9f5a510274c74d87128f7edfb709016a1f957e01"
integrity sha512-jHVnXJke0PXpuPszKtk9y1zZSlzO5+2a+aockT/AND0oeXx46FiJEFrafthurglLygVZA+1gEbtUM1C7qtTV+Q==
dependencies:
playwright-core "1.32.1"
playwright-core "1.32.2"

prelude-ls@^1.2.1:
version "1.2.1"
Expand Down Expand Up @@ -1838,10 +1838,10 @@ type-is@^1.6.16:
media-typer "0.3.0"
mime-types "~2.1.24"

typescript@^5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.2.tgz#891e1a90c5189d8506af64b9ef929fca99ba1ee5"
integrity sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==
typescript@^5.0.3:
version "5.0.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.3.tgz#fe976f0c826a88d0a382007681cbb2da44afdedf"
integrity sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==

unbzip2-stream@^1.0.9:
version "1.4.3"
Expand Down