Skip to content

Commit 96e1529

Browse files
committed
chore: fix test
1 parent 3bb35ae commit 96e1529

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

packages/core/src/node/__tests__/host-docks.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ describe('devToolsDockHost', () => {
181181
url: 'http://localhost:3001',
182182
})
183183

184-
const docks = host.values()
184+
const docks = host.values({ includeBuiltin: false })
185185
expect(docks.length).toBe(1)
186186
expect(docks[0]?.title).toBe('Updated')
187187
})

packages/core/src/node/host-docks.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ export class DevToolsDockHost implements DevToolsDockHostType {
1010
) {
1111
}
1212

13-
values(): DevToolsDockEntry[] {
13+
values({
14+
includeBuiltin = true,
15+
}: {
16+
includeBuiltin?: boolean
17+
} = {}): DevToolsDockEntry[] {
1418
const context = this.context
1519
const builtinDocksEntries: DevToolsViewBuiltin[] = [
1620
{
@@ -26,7 +30,7 @@ export class DevToolsDockHost implements DevToolsDockHostType {
2630

2731
return [
2832
...Array.from(this.views.values()),
29-
...builtinDocksEntries,
33+
...(includeBuiltin ? builtinDocksEntries : []),
3034
]
3135
}
3236

packages/kit/src/types/docks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface DevToolsDockHost {
1010
update: (patch: Partial<T>) => void
1111
}
1212
update: (entry: DevToolsDockUserEntry) => void
13-
values: () => DevToolsDockEntry[]
13+
values: (options?: { includeBuiltin?: boolean }) => DevToolsDockEntry[]
1414
}
1515

1616
// TODO: refine categories more clearly

0 commit comments

Comments
 (0)