Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/api/test/browser/extHostFileSystemEventService.test.ts
5221 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
import assert from 'assert';
6
import { ExtHostFileSystemEventService } from '../../common/extHostFileSystemEventService.js';
7
import { IMainContext } from '../../common/extHost.protocol.js';
8
import { NullLogService } from '../../../../platform/log/common/log.js';
9
import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js';
10
import { ExtHostFileSystemInfo } from '../../common/extHostFileSystemInfo.js';
11
12
suite('ExtHostFileSystemEventService', () => {
13
14
ensureNoDisposablesAreLeakedInTestSuite();
15
16
test('FileSystemWatcher ignore events properties are reversed #26851', function () {
17
18
const protocol: IMainContext = {
19
getProxy: () => { return undefined!; },
20
set: undefined!,
21
dispose: undefined!,
22
assertRegistered: undefined!,
23
drain: undefined!
24
};
25
26
const fileSystemInfo = new ExtHostFileSystemInfo();
27
28
const watcher1 = new ExtHostFileSystemEventService(protocol, new NullLogService(), undefined!).createFileSystemWatcher(undefined!, undefined!, fileSystemInfo, undefined!, '**/somethingInteresting', {});
29
assert.strictEqual(watcher1.ignoreChangeEvents, false);
30
assert.strictEqual(watcher1.ignoreCreateEvents, false);
31
assert.strictEqual(watcher1.ignoreDeleteEvents, false);
32
watcher1.dispose();
33
34
const watcher2 = new ExtHostFileSystemEventService(protocol, new NullLogService(), undefined!).createFileSystemWatcher(undefined!, undefined!, fileSystemInfo, undefined!, '**/somethingBoring', { ignoreCreateEvents: true, ignoreChangeEvents: true, ignoreDeleteEvents: true });
35
assert.strictEqual(watcher2.ignoreChangeEvents, true);
36
assert.strictEqual(watcher2.ignoreCreateEvents, true);
37
assert.strictEqual(watcher2.ignoreDeleteEvents, true);
38
watcher2.dispose();
39
});
40
41
});
42
43