GeezerVison is showing github.com — test(core): use direct test imports (#45683) · anomalyco/opencode@a519363
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/core/test/database-drizzle.test.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,7 @@ import { SqliteClient } from "@effect/sql-sqlite-bun" | 7 | 7 | import { eq, sql } from "drizzle-orm" | 8 | 8 | import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core" | 9 | 9 | import { Effect, Tracer } from "effect" | 10 | | -import type { SqlClient as SqlClientService } from "effect/unstable/sql/SqlClient" | | 10 | +import type { SqlClient } from "effect/unstable/sql/SqlClient" | 11 | 11 | import { isSqlError } from "effect/unstable/sql/SqlError" | 12 | 12 | import { EffectDrizzleSqlite } from "@opencode-ai/core/database/drizzle" | 13 | 13 |
| @@ -16,7 +16,7 @@ const users = sqliteTable("users", { | 16 | 16 | name: text().notNull(), | 17 | 17 | }) | 18 | 18 |
| 19 | | -const run = <A, E>(effect: Effect.Effect<A, E, SqlClientService>) => | | 19 | +const run = <A, E>(effect: Effect.Effect<A, E, SqlClient>) => | 20 | 20 | Effect.runPromise( | 21 | 21 | effect.pipe(Effect.provide(SqliteClient.layer({ filename: ":memory:", disableWAL: true })), Effect.scoped), | 22 | 22 | ) | |
Collapse file Copy file name to clipboardExpand all lines: packages/core/test/effect/cross-spawn-spawner.test.ts +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,8 +2,7 @@ import { describe, expect } from "bun:test" | 2 | 2 | import fs from "node:fs/promises" | 3 | 3 | import os from "node:os" | 4 | 4 | import path from "node:path" | 5 | | -import { Effect, Exit, Stream } from "effect" | 6 | | -import type * as PlatformError from "effect/PlatformError" | | 5 | +import { Effect, Exit, PlatformError, Stream } from "effect" | 7 | 6 | import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process" | 8 | 7 | import { CrossSpawnSpawner } from "@opencode-ai/util/cross-spawn-spawner" | 9 | 8 | import { LayerNode } from "@opencode-ai/util/effect/layer-node" | |
Collapse file Copy file name to clipboardExpand all lines: packages/core/test/fixture/tmpdir.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import fs from "fs/promises" | 2 | | -import { tmpdir as osTmpdir } from "os" | | 2 | +import os from "os" | 3 | 3 | import path from "path" | 4 | 4 | import { Effect } from "effect" | 5 | 5 |
| 6 | 6 | export const tmpdir = async (prefix = "opencode-core-test-") => { | 7 | | - const dir = await fs.realpath(await fs.mkdtemp(path.join(osTmpdir(), prefix))) | | 7 | + const dir = await fs.realpath(await fs.mkdtemp(path.join(os.tmpdir(), prefix))) | 8 | 8 | return { | 9 | 9 | path: dir, | 10 | 10 | async [Symbol.asyncDispose]() { | |
Collapse file Copy file name to clipboardExpand all lines: packages/core/test/instructions/builtins.test.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { describe, expect } from "bun:test" | 2 | 2 | import os from "os" | 3 | 3 | import { Effect, Layer } from "effect" | 4 | | -import * as TestClock from "effect/testing/TestClock" | | 4 | +import { TestClock } from "effect/testing" | 5 | 5 | import { AppNodeBuilder } from "@opencode-ai/core/effect/app-node-builder" | 6 | 6 | import { Location } from "@opencode-ai/core/location" | 7 | 7 | import { FSUtil } from "@opencode-ai/util/fs-util" | |
Collapse file Copy file name to clipboardExpand all lines: packages/core/test/integration.test.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { describe, expect } from "bun:test" | 2 | 2 | import { Cause, Clock, Duration, Effect, Exit, Fiber, Layer, Scope, Stream } from "effect" | 3 | | -import * as TestClock from "effect/testing/TestClock" | | 3 | +import { TestClock } from "effect/testing" | 4 | 4 | import { Credential } from "@opencode-ai/core/credential" | 5 | 5 | import { AppNodeBuilder } from "@opencode-ai/core/effect/app-node-builder" | 6 | 6 | import { makeGlobalNode } from "@opencode-ai/util/effect/app-node" | |
Collapse file Copy file name to clipboardExpand all lines: packages/core/test/lib/effect.ts +2-3Lines changed: 2 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import { test, type TestOptions } from "bun:test" | 2 | | -import { Cause, Effect, Exit, Layer, Scope } from "effect" | 3 | | -import * as TestClock from "effect/testing/TestClock" | 4 | | -import * as TestConsole from "effect/testing/TestConsole" | | 2 | +import { Cause, Effect, Exit, Layer, type Scope } from "effect" | | 3 | +import { TestClock, TestConsole } from "effect/testing" | 5 | 4 |
| 6 | 5 | type Body<A, E, R> = Effect.Effect<A, E, R> | (() => Effect.Effect<A, E, R>) | 7 | 6 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/core/test/lib/tool.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -4,7 +4,7 @@ import { SessionMessage } from "@opencode-ai/core/session/message" | 4 | 4 | import { toSessionError } from "@opencode-ai/core/session/to-session-error" | 5 | 5 | import type { SessionError } from "@opencode-ai/schema/session-error" | 6 | 6 | import { Tool } from "@opencode-ai/core/tool" | 7 | | -import type { Context as PluginContext } from "@opencode-ai/plugin/effect/plugin" | | 7 | +import type { Context } from "@opencode-ai/plugin/effect/plugin" | 8 | 8 | import { Effect, type Scope } from "effect" | 9 | 9 | import { host } from "../plugin/host" | 10 | 10 |
| @@ -52,7 +52,7 @@ export function waitForCodeModeTool( | 52 | 52 | export const registerToolPlugin = <R>( | 53 | 53 | plugin: { | 54 | 54 | readonly id: string | 55 | | - readonly effect: (context: PluginContext) => Effect.Effect<void, never, R> | | 55 | + readonly effect: (context: Context) => Effect.Effect<void, never, R> | 56 | 56 | }, | 57 | 57 | overrides: Parameters<typeof host>[0] = {}, | 58 | 58 | ): Effect.Effect<void, never, R | Tool.Service | Scope.Scope> => | |
|