Skip to content

Commit 2a05a99

Browse files
committed
f
1 parent 9a78e39 commit 2a05a99

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/utils/sequencify.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ function sequence(tasks: Record<string, SequencifyTask>,
1818
missing: string[], recursive: string[],
1919
nest: string[], optional: boolean, parent: string) {
2020
for (const name of names) {
21-
if (result.requires[name]) return;
22-
21+
if (result.requires[name]) {
22+
continue;
23+
}
2324
const node = tasks[name];
2425
if (!node) {
25-
if (optional === true) return;
26+
if (optional === true) {
27+
continue;
28+
}
2629
missing.push(name);
2730
} else if (nest.includes(name)) {
2831
nest.push(name);

test/index.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { strict as assert } from 'node:assert';
2+
// oxlint-disable-next-line no-namespace
23
import * as EggCore from '../src/index.js';
34
import type { EggAppConfig } from '../src/index.js';
45

@@ -31,6 +32,7 @@ describe('test/index.test.ts', () => {
3132
'Router',
3233
'Singleton',
3334
'Timing',
35+
'sequencify',
3436
'utils',
3537
]);
3638
});

test/loader/mixin/load_plugin.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,12 +574,11 @@ describe('test/loader/mixin/load_plugin.test.ts', () => {
574574
assert.equal(loader.allPlugins.zzz.path, getFilepath('load-plugin-config-override/plugins/zzz'));
575575
});
576576

577-
it.only('should support optionalDependencies', async () => {
577+
it('should support optionalDependencies', async () => {
578578
app = createApp('plugin-optional-dependencies');
579579
const loader = app.loader;
580580
await loader.loadPlugin();
581-
console.log(loader.orderPlugins.map(p => p.name));
582-
assert.deepEqual(loader.orderPlugins.slice(2).map(p => p.name), [ 'package', 'e', 'b', 'a', 'f' ]);
581+
assert.deepEqual(loader.orderPlugins.map(p => p.name), [ 'session', 'zzz', 'package', 'e', 'b', 'a', 'f' ]);
583582
});
584583

585584
it('should warn when redefine plugin', async () => {

0 commit comments

Comments
 (0)