mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Prevent additional layer breakers, enforce ts lint import rules in /platform/ tests
This commit is contained in:
parent
d467f0ce08
commit
3be08cf836
|
@ -4,7 +4,6 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import * as sinon from 'sinon';
|
||||
import * as assert from 'assert';
|
||||
import { IExtensionManagementService, IExtensionEnablementService, DidUninstallExtensionEvent } from 'vs/platform/extensionManagement/common/extensionManagement';
|
||||
import { ExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService';
|
||||
|
@ -13,9 +12,16 @@ import { Emitter } from 'vs/base/common/event';
|
|||
import { StorageService, InMemoryLocalStorage } from 'vs/platform/storage/common/storageService';
|
||||
import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
|
||||
import { TestContextService } from 'vs/workbench/test/workbenchTestServices';
|
||||
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
|
||||
|
||||
// TODO@Sandeep layer breaker: cannot depend on node modules from /common/ and sinon is a node module
|
||||
// tslint:disable-next-line:import-patterns
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
// TODO@Sandeep layer breaker: cannot depend on /workbench/ from /platform/
|
||||
// tslint:disable-next-line:import-patterns
|
||||
import { TestContextService } from 'vs/workbench/test/workbenchTestServices';
|
||||
|
||||
function storageService(instantiationService: TestInstantiationService): IStorageService {
|
||||
let service = instantiationService.get(IStorageService);
|
||||
if (!service) {
|
||||
|
|
|
@ -5,13 +5,16 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import * as sinon from 'sinon';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import * as types from 'vs/base/common/types';
|
||||
import { InstantiationService } from 'vs/platform/instantiation/common/instantiationService';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { ServiceIdentifier } from 'vs/platform/instantiation/common/instantiation';
|
||||
|
||||
// TODO@Sandeep layer breaker: cannot depend on node modules from /common/ and sinon is a node module
|
||||
// tslint:disable-next-line:import-patterns
|
||||
import * as sinon from 'sinon';
|
||||
|
||||
interface IServiceMock<T> {
|
||||
id: ServiceIdentifier<T>;
|
||||
service: any;
|
||||
|
|
30
tslint.json
30
tslint.json
|
@ -112,16 +112,16 @@
|
|||
"**/vs/platform/*/common/**"
|
||||
]
|
||||
},
|
||||
// {
|
||||
// "target": "**/vs/platform/*/test/common/**",
|
||||
// "restrictions": [
|
||||
// "assert",
|
||||
// "vs/nls",
|
||||
// "**/vs/base/common/**",
|
||||
// "**/vs/platform/*/common/**",
|
||||
// "**/vs/platform/*/test/common/**"
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
"target": "**/vs/platform/*/test/common/**",
|
||||
"restrictions": [
|
||||
"assert",
|
||||
"vs/nls",
|
||||
"**/vs/base/common/**",
|
||||
"**/vs/platform/*/common/**",
|
||||
"**/vs/platform/*/test/common/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/vs/platform/*/browser/**",
|
||||
"restrictions": [
|
||||
|
@ -132,6 +132,16 @@
|
|||
"**/vs/platform/*/{common,browser}/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/vs/platform/*/test/browser/**",
|
||||
"restrictions": [
|
||||
"assert",
|
||||
"vs/nls",
|
||||
"**/vs/base/{common,browser}/**",
|
||||
"**/vs/platform/*/{common,browser}/**",
|
||||
"**/vs/platform/*/test/{common,browser}/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/vs/editor/common/**",
|
||||
"restrictions": [
|
||||
|
|
Loading…
Reference in a new issue