@@ -10,7 +10,7 @@ import { createDB } from "@intx/db";
1010import { listWorkflowDeployments , listWorkflowRuns , readWorkflowRunEvents } from "@intx/hub-client" ;
1111import { parseTriageState , triageStateName , type PrTriageRow } from "@corbits/triage-contracts" ;
1212import { saveAutomationMode } from "../../apps/web/src/lib/hub-api.ts" ;
13- import { fakeGithub , OWNER , type Pull , type Write } from "./github.ts" ;
13+ import { fakeGithub , OWNER , type Pull } from "./github.ts" ;
1414import { stubModel , type Answer , type Question } from "./model.ts" ;
1515import { buildPortal , createDatabase , deliver , dropDatabase , listenerStarted , POLL_MS , setUpWorkspace , signUp , startHub , type Database , type Hub , type Workspace } from "./stack.ts" ;
1616
@@ -56,18 +56,6 @@ function decide(id: string, question: Question): Answer {
5656 return { type : "choice" , choice : first ! , probabilities : { [ first ! ] : 0.96 , ...Object . fromEntries ( rest . map ( ( option ) => [ option , 0.04 / rest . length ] ) ) } , confidence : 0.96 } ;
5757}
5858
59- export function sha ( seed : string ) : string {
60- return new Bun . CryptoHasher ( "sha1" ) . update ( seed ) . digest ( "hex" ) ;
61- }
62-
63- export function pullOf ( number : number , head : string ) : Pull {
64- return {
65- number, title : "fix: widget sizing" , body : "Fixes the widget's size." , author : "octocat" , head,
66- files : [ { filename : "src/widget.ts" , status : "modified" , additions : 1 , deletions : 1 , patch : "@@ -1 +1 @@\n-export const size = 1;\n+export const size = 2;" } ] ,
67- commits : [ "fix: widget sizing" ] , labels : [ ] , comments : [ ] ,
68- } ;
69- }
70-
7159export type Claim = { status : "live" | "ended" ; runId ?: string ; history : { head : string ; runId : string ; doneAt : string } [ ] } ;
7260
7361/** This test file's stack, started before its tests and stopped after them; call it once, at the file's top level. `env` overrides the hub's. */
@@ -228,14 +216,6 @@ export function chainStack(env: Record<string, string> = {}) {
228216 } ;
229217}
230218
231- export function comments ( writes : readonly Write [ ] ) : string [ ] {
232- return writes . filter ( ( write ) => write . method === "POST" && write . path . endsWith ( "/comments" ) ) . map ( ( write ) => String ( ( write . body as { body : string } ) . body ) ) ;
233- }
234-
235- export function labelled ( writes : readonly Write [ ] ) : string [ ] {
236- return writes . filter ( ( write ) => write . method === "POST" && write . path . endsWith ( "/labels" ) ) . flatMap ( ( write ) => ( write . body as { labels : string [ ] } ) . labels ) ;
237- }
238-
239219/** Runs `scenario` once, on the first test that asks for it. */
240220export function once < T > ( scenario : ( ) => Promise < T > ) : ( ) => Promise < T > {
241221 let started : Promise < T > | undefined ;
0 commit comments