mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 05:51:32 +01:00
a bunch of failing tests
This commit is contained in:
@@ -72,3 +72,44 @@ export function withLogDisabled(runnable: () => Promise<any>): () => Promise<voi
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function assertNoRpc() {
|
||||
|
||||
const symProxy = Symbol.for('rpcProxy');
|
||||
const symProtocol = Symbol.for('rpcProtocol');
|
||||
|
||||
const proxyPaths: string[] = [];
|
||||
const rpcPaths: string[] = [];
|
||||
|
||||
function walk(obj: any, path: string, seen: Set<any>) {
|
||||
if (!obj) {
|
||||
return;
|
||||
}
|
||||
if (typeof obj !== 'object' && typeof obj !== 'function') {
|
||||
return;
|
||||
}
|
||||
if (seen.has(obj)) {
|
||||
return;
|
||||
}
|
||||
seen.add(obj);
|
||||
|
||||
if (obj[symProtocol]) {
|
||||
rpcPaths.push(`PROTOCOL via ${path}`);
|
||||
}
|
||||
if (obj[symProxy]) {
|
||||
proxyPaths.push(`PROXY '${obj[symProxy]}' via ${path}`);
|
||||
}
|
||||
|
||||
for (const key in obj) {
|
||||
walk(obj[key], `${path}.${String(key)}`, seen);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
walk(vscode, 'vscode', new Set());
|
||||
} catch (err) {
|
||||
assert.fail(err);
|
||||
}
|
||||
assert.strictEqual(rpcPaths.length, 0, rpcPaths.join('\n'));
|
||||
assert.strictEqual(proxyPaths.length, 0, proxyPaths.join('\n')); // happens...
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user