Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "guided-development",
"version": "0.1.4",
"version": "0.1.5",
"displayName": "Guided Development",
"publisher": "SAPOSS",
"author": {
Expand Down Expand Up @@ -55,7 +55,7 @@
"commandPalette": [
{
"command": "loadGuidedDevelopment",
"when": "false"
"when": "true"
},
{
"command": "guidedDevelopment.toggleOutput",
Expand Down
3 changes: 3 additions & 0 deletions backend/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ let guidedDevelopmentPanel: GuidedDevelopmentPanel;

export async function activate(context: vscode.ExtensionContext) {
extContext = context;

const isInVscode = _.isEmpty(_.get(process, "env.WS_BASE_URL"));
await vscode.commands.executeCommand("setContext", "isInVscode", isInVscode);

try {
createExtensionLoggerAndSubscribeToLogSettingsChanges(context);
Expand Down
8 changes: 4 additions & 4 deletions backend/tests/extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,23 @@ describe('extension unit test', () => {
});

describe('activate', () => {
it("commands registration", () => {
it("commands registration", async () => {
// contributorsMock.expects("getContributors");
loggerWrapperMock.expects("createExtensionLoggerAndSubscribeToLogSettingsChanges");
loggerWrapperMock.expects("getLogger").once();
const res: typeof bas = eventMock.expects("getExtension").withExactArgs("SAPOSS.app-studio-toolkit")?.exports;
vscodeEventMock.expects("setBasAPI").withExactArgs(res);
extension.activate(testContext);
await extension.activate(testContext);
expect(_.size(_.keys(oRegisteredCommands))).to.be.equal(2);
expect( _.get(oRegisteredCommands, "loadGuidedDevelopment")).to.be.not.undefined;
expect(_.get(oRegisteredCommands, "guidedDevelopment.toggleOutput")).to.be.not.undefined;
});

it("logger failure on extenion activation", () => {
it("logger failure on extenion activation", async () => {
const consoleMock = sandbox.mock(console);
loggerWrapperMock.expects("createExtensionLoggerAndSubscribeToLogSettingsChanges").throws(new Error("activation error"));
consoleMock.expects("error").withExactArgs('Extension activation failed due to Logger configuration failure:', "activation error");
extension.activate(null);
await extension.activate(null);
});
});

Expand Down