test(features): remove unsafe test assertions
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -20,15 +20,15 @@ describe("TaskToastManager", () => {
|
||||
showToast: mock(() => Promise.resolve()),
|
||||
},
|
||||
}
|
||||
mockConcurrencyManager = {
|
||||
mockConcurrencyManager = testCoerce<ConcurrencyManager>({
|
||||
getConcurrencyLimit: mock(() => 5),
|
||||
} as unknown as ConcurrencyManager
|
||||
})
|
||||
|
||||
const mod = await import("./manager")
|
||||
TaskToastManager = mod.TaskToastManager
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
toastManager = new TaskToastManager(mockClient as any, mockConcurrencyManager)
|
||||
toastManager = new TaskToastManager(testCoerce(mockClient), mockConcurrencyManager)
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
@@ -108,14 +108,14 @@ describe("TaskToastManager", () => {
|
||||
|
||||
test("should display concurrency limit info when available", () => {
|
||||
// given - a concurrency manager with known limit
|
||||
const mockConcurrencyWithCounts = {
|
||||
const mockConcurrencyWithCounts = testCoerce<ConcurrencyManager>({
|
||||
getConcurrencyLimit: mock(() => 5),
|
||||
getRunningCount: mock(() => 2),
|
||||
getQueuedCount: mock(() => 1),
|
||||
} as unknown as ConcurrencyManager
|
||||
})
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const managerWithConcurrency = new TaskToastManager(mockClient as any, mockConcurrencyWithCounts)
|
||||
const managerWithConcurrency = new TaskToastManager(testCoerce(mockClient), mockConcurrencyWithCounts)
|
||||
|
||||
// when - a task is added
|
||||
managerWithConcurrency.addTask({
|
||||
@@ -357,11 +357,11 @@ describe("TaskToastManager", () => {
|
||||
|
||||
test("should show model name in queued tasks too", () => {
|
||||
// given - a concurrency manager that limits to 1
|
||||
const limitedConcurrency = {
|
||||
const limitedConcurrency = testCoerce<ConcurrencyManager>({
|
||||
getConcurrencyLimit: mock(() => 1),
|
||||
} as unknown as ConcurrencyManager
|
||||
})
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const limitedManager = new TaskToastManager(mockClient as any, limitedConcurrency)
|
||||
const limitedManager = new TaskToastManager(testCoerce(mockClient), limitedConcurrency)
|
||||
|
||||
limitedManager.addTask({
|
||||
id: "task_running",
|
||||
|
||||
Reference in New Issue
Block a user