Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug that prevents any startup plugins from activating #391

Merged
merged 3 commits into from
Sep 6, 2022
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
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