File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,21 +5,13 @@ export type Backend = "effect-httpapi" | "hono"
55
66export type Selection = {
77 backend : Backend
8- reason : "env" | "channel" | " stable" | "explicit"
8+ reason : "env" | "stable" | "explicit"
99}
1010
1111export type Attributes = ReturnType < typeof attributes >
1212
13- const channelDefaultsToHttpApi = ( ) =>
14- InstallationChannel === "local" ||
15- InstallationChannel === "dev" ||
16- InstallationChannel === "beta" ||
17- InstallationVersion . includes ( "-dev" ) ||
18- InstallationVersion . includes ( "-beta" )
19-
2013export function select ( ) : Selection {
2114 if ( Flag . OPENCODE_EXPERIMENTAL_HTTPAPI ) return { backend : "effect-httpapi" , reason : "env" }
22- if ( channelDefaultsToHttpApi ( ) ) return { backend : "effect-httpapi" , reason : "channel" }
2315 return { backend : "hono" , reason : "stable" }
2416}
2517
Original file line number Diff line number Diff line change @@ -146,9 +146,12 @@ afterEach(async () => {
146146} )
147147
148148describe ( "HttpApi server" , ( ) => {
149- test ( "defaults local/dev builds to the Effect HttpApi backend " , ( ) => {
149+ test ( "keeps Effect HttpApi behind the feature flag " , ( ) => {
150150 Flag . OPENCODE_EXPERIMENTAL_HTTPAPI = false
151- expect ( Server . backend ( ) . backend ) . toBe ( "effect-httpapi" )
151+ expect ( Server . backend ( ) ) . toEqual ( { backend : "hono" , reason : "stable" } )
152+
153+ Flag . OPENCODE_EXPERIMENTAL_HTTPAPI = true
154+ expect ( Server . backend ( ) ) . toEqual ( { backend : "effect-httpapi" , reason : "env" } )
152155 } )
153156
154157 test ( "covers every generated OpenAPI route with Effect HttpApi contracts" , async ( ) => {
You can’t perform that action at this time.
0 commit comments