Skip to content

Commit

Permalink
Merge pull request #391 from afshin/startup-fix
Browse files Browse the repository at this point in the history
Fix bug that prevents any startup plugins from activating
  • Loading branch information
jtpio authored Sep 6, 2022
2 parents 2d9b7aa + a25a527 commit 04e2e5b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/application/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ namespace Private {
const collection = new Map<string, boolean>();

// Collect the auto-start plugins.
for (const id in plugins) {
for (const id of plugins.keys()) {
if (plugins.get(id)!.autoStart) {
collection.set(id, true);
}
Expand Down
14 changes: 14 additions & 0 deletions packages/application/tests/src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ describe('@lumino/application', () => {
expect(app.isPluginActivated(id)).to.be.true;
});

it('should be true for an autoStart plugin', async () => {
const app = new Application({ shell: new Widget() });
const id = 'plugin1';
app.registerPlugin({
id,
activate: () => {
// no-op
},
autoStart: true
});
await app.start();
expect(app.isPluginActivated(id)).to.be.true;
});

it('should be false for not activated plugin', async () => {
const app = new Application({ shell: new Widget() });
const id = 'plugin1';
Expand Down

0 comments on commit 04e2e5b

Please sign in to comment.