Path: blob/main/src/vs/workbench/api/test/browser/extHostFileSystemEventService.test.ts
5221 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/4import assert from 'assert';5import { ExtHostFileSystemEventService } from '../../common/extHostFileSystemEventService.js';6import { IMainContext } from '../../common/extHost.protocol.js';7import { NullLogService } from '../../../../platform/log/common/log.js';8import { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js';9import { ExtHostFileSystemInfo } from '../../common/extHostFileSystemInfo.js';1011suite('ExtHostFileSystemEventService', () => {1213ensureNoDisposablesAreLeakedInTestSuite();1415test('FileSystemWatcher ignore events properties are reversed #26851', function () {1617const protocol: IMainContext = {18getProxy: () => { return undefined!; },19set: undefined!,20dispose: undefined!,21assertRegistered: undefined!,22drain: undefined!23};2425const fileSystemInfo = new ExtHostFileSystemInfo();2627const watcher1 = new ExtHostFileSystemEventService(protocol, new NullLogService(), undefined!).createFileSystemWatcher(undefined!, undefined!, fileSystemInfo, undefined!, '**/somethingInteresting', {});28assert.strictEqual(watcher1.ignoreChangeEvents, false);29assert.strictEqual(watcher1.ignoreCreateEvents, false);30assert.strictEqual(watcher1.ignoreDeleteEvents, false);31watcher1.dispose();3233const watcher2 = new ExtHostFileSystemEventService(protocol, new NullLogService(), undefined!).createFileSystemWatcher(undefined!, undefined!, fileSystemInfo, undefined!, '**/somethingBoring', { ignoreCreateEvents: true, ignoreChangeEvents: true, ignoreDeleteEvents: true });34assert.strictEqual(watcher2.ignoreChangeEvents, true);35assert.strictEqual(watcher2.ignoreCreateEvents, true);36assert.strictEqual(watcher2.ignoreDeleteEvents, true);37watcher2.dispose();38});3940});414243