Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#200091 adopt ensureNoDisposablesAreLeakedInTestSuite #202241

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@
"src/vs/platform/contextkey/test/common/contextkey.test.ts",
"src/vs/platform/contextkey/test/common/parser.test.ts",
"src/vs/platform/contextkey/test/common/scanner.test.ts",
"src/vs/platform/extensionManagement/test/common/extensionManagement.test.ts",
"src/vs/platform/extensions/test/common/extensionValidator.test.ts",
"src/vs/platform/instantiation/test/common/graph.test.ts",
"src/vs/platform/instantiation/test/common/instantiationService.test.ts",
Expand Down Expand Up @@ -202,7 +201,6 @@
"src/vs/workbench/contrib/chat/test/common/chatWordCounter.test.ts",
"src/vs/workbench/contrib/editSessions/test/browser/editSessions.test.ts",
"src/vs/workbench/contrib/extensions/test/common/extensionQuery.test.ts",
"src/vs/workbench/contrib/extensions/test/electron-sandbox/extension.test.ts",
"src/vs/workbench/contrib/notebook/test/browser/notebookExecutionService.test.ts",
"src/vs/workbench/contrib/notebook/test/browser/notebookExecutionStateService.test.ts",
"src/vs/workbench/contrib/snippets/test/browser/snippetFile.test.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import { getDomainsOfRemotes, getRemotes } from 'vs/platform/extensionManagement

suite('Config Remotes', () => {

ensureNoDisposablesAreLeakedInTestSuite();

const allowedDomains = [
'github.com',
'github2.com',
Expand Down Expand Up @@ -129,5 +131,4 @@ suite('Config Remotes', () => {
`;
}

ensureNoDisposablesAreLeakedInTestSuite();
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils';
import { EXTENSION_IDENTIFIER_PATTERN } from 'vs/platform/extensionManagement/common/extensionManagement';
import { ExtensionKey } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
import { TargetPlatform } from 'vs/platform/extensions/common/extensions';

suite('Extension Identifier Pattern', () => {

ensureNoDisposablesAreLeakedInTestSuite();

test('extension identifier pattern', () => {
const regEx = new RegExp(EXTENSION_IDENTIFIER_PATTERN);
assert.strictEqual(true, regEx.test('publisher.name'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@ import { getGalleryExtensionId } from 'vs/platform/extensionManagement/common/ex
import { generateUuid } from 'vs/base/common/uuid';
import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock';
import { IProductService } from 'vs/platform/product/common/productService';
import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils';

suite('Extension Test', () => {

const disposables = ensureNoDisposablesAreLeakedInTestSuite();

let instantiationService: TestInstantiationService;

setup(() => {
instantiationService = new TestInstantiationService();
instantiationService = disposables.add(new TestInstantiationService());
instantiationService.stub(IProductService, { quality: 'insiders' });
});

teardown(() => {
instantiationService.dispose();
});

test('extension is not outdated when there is no local and gallery', () => {
const extension = instantiationService.createInstance(Extension, () => ExtensionState.Installed, () => undefined, undefined, undefined, undefined);
assert.strictEqual(extension.outdated, false);
Expand Down