11import test from "ava" ;
22
33import { BundlePlatform } from "./bundle-platform" ;
4- import { ActionsEnvVars , ReadOnlyEnv } from "./environment" ;
4+ import { ActionsEnvVars , Env } from "./environment" ;
55import { Feature } from "./feature-flags" ;
66import { BuiltInLanguage } from "./languages" ;
77import {
@@ -13,6 +13,7 @@ import {
1313 createFeatures ,
1414 getRecordingLogger ,
1515 getTestEnv ,
16+ initAllState ,
1617 LoggedMessage ,
1718} from "./testing-utils" ;
1819import { GitHubVariant } from "./util" ;
@@ -30,16 +31,16 @@ const ELIGIBLE_OPTIONS: PerLanguageBundleOptions = {
3031async function checkEligibility (
3132 overrides : Partial < PerLanguageBundleOptions > ,
3233 enabledFeatures : Feature [ ] = [ Feature . PerLanguageBundles ] ,
33- env : ReadOnlyEnv = getTestEnv ( {
34+ env : Env = getTestEnv ( {
3435 [ ActionsEnvVars . RUNNER_ENVIRONMENT ] : "github-hosted" ,
3536 } ) ,
3637) {
3738 return getPerLanguageBundleLanguage (
38- {
39+ initAllState ( {
3940 env,
4041 features : createFeatures ( enabledFeatures ) ,
4142 logger : getRecordingLogger ( [ ] , { logToConsole : false } ) ,
42- } ,
43+ } ) ,
4344 { ...ELIGIBLE_OPTIONS , ...overrides } ,
4445 ) ;
4546}
@@ -130,11 +131,11 @@ test("getPerLanguageBundleLanguage requires the feature flag", async (t) => {
130131test ( "getPerLanguageBundleLanguage explains a disabled feature before checking eligibility" , async ( t ) => {
131132 const messages : LoggedMessage [ ] = [ ] ;
132133 const language = await getPerLanguageBundleLanguage (
133- {
134+ initAllState ( {
134135 env : getTestEnv ( ) ,
135136 features : createFeatures ( [ ] ) ,
136137 logger : getRecordingLogger ( messages , { logToConsole : false } ) ,
137- } ,
138+ } ) ,
138139 { ...ELIGIBLE_OPTIONS , rawLanguages : undefined , cliVersion : undefined } ,
139140 ) ;
140141
0 commit comments