Skip to content
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
12 changes: 12 additions & 0 deletions packages/core/src/node/__tests__/plugin-options.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { DevToolsConfig } from '../config'
import type { DevTools } from '../plugins'
import { expectTypeOf, it } from 'vitest'

it('accepts config options and an integration directory', () => {
type Options = Parameters<typeof DevTools>[0]
type Expected = (Omit<DevToolsConfig, 'enabled' | 'apply'> & { cwd?: string }) | undefined

expectTypeOf<keyof NonNullable<Options>>().toEqualTypeOf<keyof NonNullable<Expected>>()
expectTypeOf<Options>().toExtend<Expected>()
expectTypeOf<Expected>().toExtend<Options>()
})
4 changes: 3 additions & 1 deletion packages/core/src/node/plugin-options.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { DevToolsConfig } from './config'

export type DevToolsBrandingLogo
= | string
| { light: string, dark: string }
Expand Down Expand Up @@ -72,7 +74,7 @@ export interface DevToolsUserOptions {
}
}

export interface DevToolsOptions extends DevToolsUserOptions {
export interface DevToolsOptions extends Omit<DevToolsConfig, 'enabled' | 'apply'> {
/** Directory to search for installed integrations. */
cwd?: string
}
6 changes: 4 additions & 2 deletions packages/core/src/node/plugins/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ describe('devTools', () => {
const plugins = await DevTools({
builtinDevTools: false,
embeddedVisibility: 'passive',
clientAuth: false,
clientAuthTokens: ['token'],
})
const config = await resolveConfig({
configFile: false,
Expand All @@ -56,8 +58,8 @@ describe('devTools', () => {
apply: 'all',
config: {
builtinDevTools: false,
clientAuth: true,
clientAuthTokens: [],
clientAuth: false,
clientAuthTokens: ['token'],
embeddedVisibility: 'passive',
host: 'localhost',
},
Expand Down
Loading