Skip to content

Commit

Permalink
refactor: return reload status
Browse files Browse the repository at this point in the history
  • Loading branch information
joacoc committed Nov 7, 2023
1 parent 5836840 commit b87f251
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/context/asyncContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ export default class AsyncContext extends Context {
this.config.setProfile(name);
this.environment = undefined;
try {
await this.reloadContext();
return true;
const success = await this.reloadContext();
return success;
} catch (err) {
this.handleErr(err, "Error reloading context.");
console.error("[AsyncContext]", "Error reloading context: ", err);
Expand Down Expand Up @@ -327,7 +327,7 @@ export default class AsyncContext extends Context {
* Reloads the whole context.
*/
private async reloadContext() {
this.isReadyPromise = new Promise((res, rej) => {
this.isReadyPromise = new Promise((res) => {
const asyncOp = async () => {
try {
await this.loadContext();
Expand Down
2 changes: 1 addition & 1 deletion src/test/suite/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ suite('Extension Test Suite', () => {
const context: AsyncContext = await extension.activate();
const success = await context.setProfile("invalid_profile");

assert.ok(success === false);
assert.ok(!success);

}).timeout(10000);
});

0 comments on commit b87f251

Please sign in to comment.