Path: blob/main/src/vs/workbench/api/test/browser/extHostFileSystemEventService.test.ts
3296 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';910suite('ExtHostFileSystemEventService', () => {1112ensureNoDisposablesAreLeakedInTestSuite();1314test('FileSystemWatcher ignore events properties are reversed #26851', function () {1516const protocol: IMainContext = {17getProxy: () => { return undefined!; },18set: undefined!,19dispose: undefined!,20assertRegistered: undefined!,21drain: undefined!22};2324const watcher1 = new ExtHostFileSystemEventService(protocol, new NullLogService(), undefined!).createFileSystemWatcher(undefined!, undefined!, undefined!, '**/somethingInteresting', {});25assert.strictEqual(watcher1.ignoreChangeEvents, false);26assert.strictEqual(watcher1.ignoreCreateEvents, false);27assert.strictEqual(watcher1.ignoreDeleteEvents, false);28watcher1.dispose();2930const watcher2 = new ExtHostFileSystemEventService(protocol, new NullLogService(), undefined!).createFileSystemWatcher(undefined!, undefined!, undefined!, '**/somethingBoring', { ignoreCreateEvents: true, ignoreChangeEvents: true, ignoreDeleteEvents: true });31assert.strictEqual(watcher2.ignoreChangeEvents, true);32assert.strictEqual(watcher2.ignoreCreateEvents, true);33assert.strictEqual(watcher2.ignoreDeleteEvents, true);34watcher2.dispose();35});3637});383940