mirror of
https://github.com/coder/code-server.git
synced 2025-07-29 04:52:53 +08:00
chore(vscode): update to 1.53.2
These conflicts will be resolved in the following commits. We do it this way so that PR review is possible.
This commit is contained in:
@ -5,6 +5,60 @@
|
||||
|
||||
/*eslint-env mocha*/
|
||||
|
||||
(function() {
|
||||
const fs = require('fs');
|
||||
const originals = {};
|
||||
let logging = false;
|
||||
let withStacks = false;
|
||||
|
||||
self.beginLoggingFS = (_withStacks) => {
|
||||
logging = true;
|
||||
withStacks = _withStacks || false;
|
||||
};
|
||||
self.endLoggingFS = () => {
|
||||
logging = false;
|
||||
withStacks = false;
|
||||
};
|
||||
|
||||
function createSpy(element, cnt) {
|
||||
return function(...args) {
|
||||
if (logging) {
|
||||
console.log(`calling ${element}: ` + args.slice(0, cnt).join(',') + (withStacks ? (`\n` + new Error().stack.split('\n').slice(2).join('\n')) : ''));
|
||||
}
|
||||
return originals[element].call(this, ...args);
|
||||
};
|
||||
}
|
||||
|
||||
function intercept(element, cnt) {
|
||||
originals[element] = fs[element];
|
||||
fs[element] = createSpy(element, cnt);
|
||||
}
|
||||
|
||||
[
|
||||
['realpathSync', 1],
|
||||
['readFileSync', 1],
|
||||
['openSync', 3],
|
||||
['readSync', 1],
|
||||
['closeSync', 1],
|
||||
['readFile', 2],
|
||||
['mkdir', 1],
|
||||
['lstat', 1],
|
||||
['stat', 1],
|
||||
['watch', 1],
|
||||
['readdir', 1],
|
||||
['access', 2],
|
||||
['open', 2],
|
||||
['write', 1],
|
||||
['fdatasync', 1],
|
||||
['close', 1],
|
||||
['read', 1],
|
||||
['unlink', 1],
|
||||
['rmdir', 1],
|
||||
].forEach((element) => {
|
||||
intercept(element[0], element[1]);
|
||||
})
|
||||
})();
|
||||
|
||||
const { ipcRenderer } = require('electron');
|
||||
const assert = require('assert');
|
||||
const path = require('path');
|
||||
@ -135,9 +189,9 @@ function serializeSuite(suite) {
|
||||
tests: suite.tests.map(serializeRunnable),
|
||||
title: suite.title,
|
||||
fullTitle: suite.fullTitle(),
|
||||
titlePath: suite.titlePath(),
|
||||
timeout: suite.timeout(),
|
||||
retries: suite.retries(),
|
||||
enableTimeouts: suite.enableTimeouts(),
|
||||
slow: suite.slow(),
|
||||
bail: suite.bail()
|
||||
};
|
||||
@ -147,6 +201,7 @@ function serializeRunnable(runnable) {
|
||||
return {
|
||||
title: runnable.title,
|
||||
fullTitle: runnable.fullTitle(),
|
||||
titlePath: runnable.titlePath(),
|
||||
async: runnable.async,
|
||||
slow: runnable.slow(),
|
||||
speed: runnable.speed,
|
||||
|
Reference in New Issue
Block a user