Skip to content

Commit

Permalink
Fixed package testing (#665)
Browse files Browse the repository at this point in the history
* Fixed testing
  • Loading branch information
ole1986 authored Jul 4, 2021
1 parent 6d5d225 commit 0ec5580
Show file tree
Hide file tree
Showing 8 changed files with 41,742 additions and 9,381 deletions.
39 changes: 0 additions & 39 deletions build/postInstall.js

This file was deleted.

51,047 changes: 41,724 additions & 9,323 deletions package-lock.json

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@
"test-extension": "node ./dist/test/runTest.js",
"webpack": "webpack -p --progress --colors",
"webpack-dev": "webpack --progress --colors --watch",
"postinstall": "node ./node_modules/vscode/bin/install && node ./build/postInstall.js",
"lint": "eslint 'src/**/*.ts' && eslint 'browser/src/**/*.ts*'",
"fix": "eslint --fix \"src/**/*.ts\" && eslint --fix \"browser/src/**/*.ts*\"",
"precommit": "lint-staged",
Expand All @@ -427,11 +426,11 @@
]
},
"devDependencies": {
"@storybook/addon-actions": "^5.3.17",
"@storybook/addon-actions": "^6.3.2",
"@storybook/addon-info": "^5.3.17",
"@storybook/addon-links": "^5.3.17",
"@storybook/addons": "^5.3.17",
"@storybook/react": "^5.3.17",
"@storybook/react": "^3.4.12",
"@types/chai": "^4.2.9",
"@types/clipboard": "^2.0.1",
"@types/fs-extra": "^8.0.0",
Expand All @@ -450,6 +449,7 @@
"@types/react-router-dom": "^5.1.3",
"@types/react-router-redux": "^5.0.18",
"@types/redux-actions": "^2.2.2",
"@types/vscode": "^1.46.0",
"@typescript-eslint/eslint-plugin": "^2.21.0",
"@typescript-eslint/parser": "^2.21.0",
"axios": "^0.21.1",
Expand Down Expand Up @@ -499,8 +499,7 @@
"tsconfig-paths-webpack-plugin": "^3.2.0",
"typemoq": "^2.1.0",
"typescript": "^3.8.2",
"vscode": "^1.1.36",
"vscode-test": "^1.3.0",
"vscode-test": "^1.5.2",
"webpack": "4.41.6",
"webpack-cli": "^3.3.11"
},
Expand Down
2 changes: 1 addition & 1 deletion src/application/types/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface IWorkspaceService {
*
* @readonly
*/
readonly workspaceFolders: WorkspaceFolder[] | undefined;
readonly workspaceFolders: ReadonlyArray<WorkspaceFolder> | undefined;

/**
* An event that is emitted when a workspace folder is added or removed.
Expand Down
2 changes: 1 addition & 1 deletion src/application/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class WorkspaceService implements IWorkspaceService {
public get onDidChangeConfiguration(): Event<ConfigurationChangeEvent> {
return workspace.onDidChangeConfiguration;
}
public get workspaceFolders(): WorkspaceFolder[] | undefined {
public get workspaceFolders(): ReadonlyArray<WorkspaceFolder> | undefined {
return workspace.workspaceFolders;
}
public get onDidChangeWorkspaceFolders(): Event<WorkspaceFoldersChangeEvent> {
Expand Down
10 changes: 5 additions & 5 deletions src/viewers/commitViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import { ICommitViewer } from './types';
export class CommitViewer implements ICommitViewer, TreeDataProvider<DirectoryNode | FileNode> {
private registered = false;
private commit?: CommitDetails;
private _onDidChangeTreeData = new EventEmitter<DirectoryNode | FileNode>();
private _onDidChangeTreeData = new EventEmitter<DirectoryNode | FileNode | undefined>();
private fileView = false;
public get onDidChangeTreeData(): Event<DirectoryNode | FileNode> {
public get onDidChangeTreeData(): Event<DirectoryNode | FileNode | undefined> {
return this._onDidChangeTreeData.event;
}
public get selectedCommit(): Readonly<CommitDetails> {
Expand All @@ -37,7 +37,7 @@ export class CommitViewer implements ICommitViewer, TreeDataProvider<DirectoryNo
this.registered = true;
window.registerTreeDataProvider(this.treeId, this);
}
this._onDidChangeTreeData.fire();
this._onDidChangeTreeData.fire(undefined);
this.commandManager.executeCommand('setContext', this.visibilityContextVariable, true);
}
public showCommit(commit: CommitDetails): void {
Expand All @@ -47,11 +47,11 @@ export class CommitViewer implements ICommitViewer, TreeDataProvider<DirectoryNo
}
public showFilesView(): void {
this.fileView = true;
this._onDidChangeTreeData.fire();
this._onDidChangeTreeData.fire(undefined);
}
public showFolderView(): void {
this.fileView = false;
this._onDidChangeTreeData.fire();
this._onDidChangeTreeData.fire(undefined);
}
public async getTreeItem(element: DirectoryNode | FileNode): Promise<TreeItem> {
const treeItem = await this.nodeBuilder.getTreeItem(element);
Expand Down
6 changes: 3 additions & 3 deletions test/non-extension/__mocks__/vsc/extHostedTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2089,7 +2089,7 @@ export namespace vscMockExtHostedTypes {
Expanded = 1
}

export class QuickInputButtons {
static readonly Back: vscode.QuickInputButton = { iconPath: 'back' };
}
/* export class QuickInputButtons {
static readonly Back: vscode.QuickInputButton = { iconPath: 'back' };
}*/
}
8 changes: 4 additions & 4 deletions test/non-extension/__mocks__/vscode-mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ mockedVSCode.Disposable = vscodeMocks.vscMock.Disposable as any;
mockedVSCode.CodeAction = vscodeMocks.vscMock.CodeAction;
mockedVSCode.EventEmitter = vscodeMocks.vscMock.EventEmitter;
mockedVSCode.CancellationTokenSource = vscodeMocks.vscMock.CancellationTokenSource;
mockedVSCode.CompletionItemKind = vscodeMocks.vscMock.CompletionItemKind;
// mockedVSCode.CompletionItemKind = vscodeMocks.vscMock.CompletionItemKind;
mockedVSCode.SymbolKind = vscodeMocks.vscMock.SymbolKind;
mockedVSCode.IndentAction = vscodeMocks.vscMock.IndentAction;
mockedVSCode.Uri = vscodeMocks.vscUri.URI as any;
Expand All @@ -61,7 +61,7 @@ mockedVSCode.Selection = vscodeMocks.vscMockExtHostedTypes.Selection;
mockedVSCode.Location = vscodeMocks.vscMockExtHostedTypes.Location;
mockedVSCode.SymbolInformation = vscodeMocks.vscMockExtHostedTypes.SymbolInformation;
mockedVSCode.CompletionItem = vscodeMocks.vscMockExtHostedTypes.CompletionItem;
mockedVSCode.CompletionItemKind = vscodeMocks.vscMockExtHostedTypes.CompletionItemKind;
// mockedVSCode.CompletionItemKind = vscodeMocks.vscMockExtHostedTypes.CompletionItemKind;
mockedVSCode.CodeLens = vscodeMocks.vscMockExtHostedTypes.CodeLens;
mockedVSCode.DiagnosticSeverity = vscodeMocks.vscMockExtHostedTypes.DiagnosticSeverity;
mockedVSCode.SnippetString = vscodeMocks.vscMockExtHostedTypes.SnippetString;
Expand All @@ -80,9 +80,9 @@ mockedVSCode.TreeItemCollapsibleState = vscodeMocks.vscMockExtHostedTypes.TreeIt
mockedVSCode.CodeActionKind = vscodeMocks.vscMock.CodeActionKind;
mockedVSCode.DebugAdapterExecutable = vscodeMocks.vscMock.DebugAdapterExecutable;
mockedVSCode.DebugAdapterServer = vscodeMocks.vscMock.DebugAdapterServer;
mockedVSCode.QuickInputButtons = vscodeMocks.vscMockExtHostedTypes.QuickInputButtons;
// mockedVSCode.QuickInputButtons = vscodeMocks.vscMockExtHostedTypes.QuickInputButtons;
mockedVSCode.FileType = vscodeMocks.vscMock.FileType;
mockedVSCode.FileSystemError = vscodeMocks.vscMockExtHostedTypes.FileSystemError;
// mockedVSCode.FileSystemError = vscodeMocks.vscMockExtHostedTypes.FileSystemError;

// This API is used in src/client/telemetry/telemetry.ts
const extensions = TypeMoq.Mock.ofType<typeof vscode.extensions>();
Expand Down

0 comments on commit 0ec5580

Please sign in to comment.