fix: test constract
This commit is contained in:
@@ -47,7 +47,7 @@ function sessionFakeFor() {
|
|||||||
|
|
||||||
async function bench() {
|
async function bench() {
|
||||||
const runtime = await SlotTestRuntime.create()
|
const runtime = await SlotTestRuntime.create()
|
||||||
runtime.provide('connection', { api: { settings: {} }, isLoopback: false } as never)
|
runtime.provide('connection', { api: { settings: {} }, isLoopback: false })
|
||||||
// The plugin injects both; these specs exercise no settings path.
|
// The plugin injects both; these specs exercise no settings path.
|
||||||
runtime.provide('remote', { $on: () => () => {} })
|
runtime.provide('remote', { $on: () => () => {} })
|
||||||
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ function WorkspaceProbe({ open }: EmptyWorkspaceOwnerProps) {
|
|||||||
|
|
||||||
async function bench(opts?: { blank?: boolean }) {
|
async function bench(opts?: { blank?: boolean }) {
|
||||||
const runtime = await SlotTestRuntime.create()
|
const runtime = await SlotTestRuntime.create()
|
||||||
runtime.provide('connection', { api: { settings: {} }, isLoopback: false } as never)
|
runtime.provide('connection', { api: { settings: {} }, isLoopback: false })
|
||||||
// The plugin injects both; these specs exercise no settings path.
|
// The plugin injects both; these specs exercise no settings path.
|
||||||
runtime.provide('remote', { $on: () => () => {} })
|
runtime.provide('remote', { $on: () => () => {} })
|
||||||
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
||||||
@@ -78,7 +78,7 @@ async function bench(opts?: { blank?: boolean }) {
|
|||||||
describe('resident composer', () => {
|
describe('resident composer', () => {
|
||||||
it('renders the locked view state while no session exists at all', async () => {
|
it('renders the locked view state while no session exists at all', async () => {
|
||||||
const runtime = await SlotTestRuntime.create()
|
const runtime = await SlotTestRuntime.create()
|
||||||
runtime.provide('connection', { api: { settings: {} }, isLoopback: false } as never)
|
runtime.provide('connection', { api: { settings: {} }, isLoopback: false })
|
||||||
// The plugin injects both; these specs exercise no settings path.
|
// The plugin injects both; these specs exercise no settings path.
|
||||||
runtime.provide('remote', { $on: () => () => {} })
|
runtime.provide('remote', { $on: () => () => {} })
|
||||||
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
||||||
@@ -108,7 +108,7 @@ describe('resident composer', () => {
|
|||||||
|
|
||||||
it('keeps the complete Hero tree mounted when the first Workspace session appears', async () => {
|
it('keeps the complete Hero tree mounted when the first Workspace session appears', async () => {
|
||||||
const runtime = await SlotTestRuntime.create()
|
const runtime = await SlotTestRuntime.create()
|
||||||
runtime.provide('connection', { api: { settings: {} }, isLoopback: false } as never)
|
runtime.provide('connection', { api: { settings: {} }, isLoopback: false })
|
||||||
// The plugin injects both; these specs exercise no settings path.
|
// The plugin injects both; these specs exercise no settings path.
|
||||||
runtime.provide('remote', { $on: () => () => {} })
|
runtime.provide('remote', { $on: () => () => {} })
|
||||||
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
||||||
@@ -177,7 +177,7 @@ describe('resident composer', () => {
|
|||||||
describe('prompt rejection through the assembled composer', () => {
|
describe('prompt rejection through the assembled composer', () => {
|
||||||
it('renders the promptError alert strip and keeps the draft in the machine', async () => {
|
it('renders the promptError alert strip and keeps the draft in the machine', async () => {
|
||||||
const runtime = await SlotTestRuntime.create()
|
const runtime = await SlotTestRuntime.create()
|
||||||
runtime.provide('connection', { api: { settings: {} }, isLoopback: false } as never)
|
runtime.provide('connection', { api: { settings: {} }, isLoopback: false })
|
||||||
// The plugin injects both; these specs exercise no settings path.
|
// The plugin injects both; these specs exercise no settings path.
|
||||||
runtime.provide('remote', { $on: () => () => {} })
|
runtime.provide('remote', { $on: () => () => {} })
|
||||||
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ const CHILD = 'child-1' as SessionId
|
|||||||
|
|
||||||
async function bench() {
|
async function bench() {
|
||||||
const runtime = await SlotTestRuntime.create()
|
const runtime = await SlotTestRuntime.create()
|
||||||
runtime.provide('connection', { api: { settings: {} }, isLoopback: false } as never)
|
runtime.provide('connection', { api: { settings: {} }, isLoopback: false })
|
||||||
// The plugin injects both; these specs exercise no settings path.
|
// The plugin injects both; these specs exercise no settings path.
|
||||||
runtime.provide('remote', { $on: () => () => {} })
|
runtime.provide('remote', { $on: () => () => {} })
|
||||||
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ const LAYOUT_CHILDREN = {
|
|||||||
|
|
||||||
async function bench(nodes: ToolResultNode[]) {
|
async function bench(nodes: ToolResultNode[]) {
|
||||||
const runtime = await SlotTestRuntime.create()
|
const runtime = await SlotTestRuntime.create()
|
||||||
runtime.provide('connection', { api: { settings: {} }, isLoopback: false } as never)
|
runtime.provide('connection', { api: { settings: {} }, isLoopback: false })
|
||||||
// ui-theme's Appearance row binds a durable scope through these two.
|
// ui-theme's Appearance row binds a durable scope through these two.
|
||||||
runtime.provide('remote', { $on: () => () => {} })
|
runtime.provide('remote', { $on: () => () => {} })
|
||||||
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ const LAYOUT_CHILDREN = {
|
|||||||
*/
|
*/
|
||||||
async function bench(nodes: ToolResultNode[]) {
|
async function bench(nodes: ToolResultNode[]) {
|
||||||
const runtime = await SlotTestRuntime.create()
|
const runtime = await SlotTestRuntime.create()
|
||||||
runtime.provide('connection', { api: { settings: {} }, isLoopback: false } as never)
|
runtime.provide('connection', { api: { settings: {} }, isLoopback: false })
|
||||||
// ui-theme's Appearance row binds a durable scope through these two.
|
// ui-theme's Appearance row binds a durable scope through these two.
|
||||||
runtime.provide('remote', { $on: () => () => {} })
|
runtime.provide('remote', { $on: () => () => {} })
|
||||||
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
||||||
@@ -200,7 +200,7 @@ describe('keyed toolview hole through the real machinery', () => {
|
|||||||
describe('registrant declaration injection', () => {
|
describe('registrant declaration injection', () => {
|
||||||
it('runs a registrant before ui-tool and waits on the actual toolview declaration', async () => {
|
it('runs a registrant before ui-tool and waits on the actual toolview declaration', async () => {
|
||||||
const runtime = await SlotTestRuntime.create()
|
const runtime = await SlotTestRuntime.create()
|
||||||
runtime.provide('connection', { api: { settings: {} }, isLoopback: false } as never)
|
runtime.provide('connection', { api: { settings: {} }, isLoopback: false })
|
||||||
// ui-theme's Appearance row binds a durable scope through these two.
|
// ui-theme's Appearance row binds a durable scope through these two.
|
||||||
runtime.provide('remote', { $on: () => () => {} })
|
runtime.provide('remote', { $on: () => () => {} })
|
||||||
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
runtime.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never)
|
||||||
|
|||||||
@@ -53,7 +53,9 @@ describe('Oxlint executable contract', () => {
|
|||||||
['host package source', 'packages/fs/fs-policy/src', 'packages/fs/fs-policy/tsconfig.json'],
|
['host package source', 'packages/fs/fs-policy/src', 'packages/fs/fs-policy/tsconfig.json'],
|
||||||
['host package test', 'packages/fs/fs-policy/tests', 'tsconfig.host.json'],
|
['host package test', 'packages/fs/fs-policy/tests', 'tsconfig.host.json'],
|
||||||
['client package source', 'packages/client/ui-primitives/src', 'packages/client/ui-primitives/tsconfig.json'],
|
['client package source', 'packages/client/ui-primitives/src', 'packages/client/ui-primitives/tsconfig.json'],
|
||||||
['client package test', 'packages/client/ui-trajectory/tests', 'tsconfig.client.json'],
|
// A test under packages/client states its face in the filename, so the
|
||||||
|
// probe carries the Client suffix to reach the Client aggregate.
|
||||||
|
['client package test', 'packages/client/ui-trajectory/tests', 'tsconfig.client.json', '.client.ts'],
|
||||||
['example', 'examples/headless-agent/tests', 'tsconfig.host.json'],
|
['example', 'examples/headless-agent/tests', 'tsconfig.host.json'],
|
||||||
['website', 'website', 'tsconfig.host.json'],
|
['website', 'website', 'tsconfig.host.json'],
|
||||||
] as const
|
] as const
|
||||||
@@ -66,8 +68,8 @@ probePromise()
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const paths: Array<readonly [label: string, path: string, tsconfig: string]> = []
|
const paths: Array<readonly [label: string, path: string, tsconfig: string]> = []
|
||||||
for (const [label, parent, tsconfig] of probes) {
|
for (const [label, parent, tsconfig, extension = '.ts'] of probes) {
|
||||||
const path = join(repositoryRoot, parent, `oxlint-contract-${suffix}.ts`)
|
const path = join(repositoryRoot, parent, `oxlint-contract-${suffix}${extension}`)
|
||||||
await writeFile(path, source)
|
await writeFile(path, source)
|
||||||
paths.push([label, relative(repositoryRoot, path), tsconfig])
|
paths.push([label, relative(repositoryRoot, path), tsconfig])
|
||||||
}
|
}
|
||||||
@@ -98,7 +100,8 @@ probePromise()
|
|||||||
expect(output).not.toContain('Unmatched file:')
|
expect(output).not.toContain('Unmatched file:')
|
||||||
} finally {
|
} finally {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
...probes.map(([, parent]) => rm(join(repositoryRoot, parent, `oxlint-contract-${suffix}.ts`), { force: true })),
|
...probes.map(([, parent, , extension = '.ts']) =>
|
||||||
|
rm(join(repositoryRoot, parent, `oxlint-contract-${suffix}${extension}`), { force: true })),
|
||||||
rm(configPath, { force: true }),
|
rm(configPath, { force: true }),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user