feat(FN-4650): complete Step 1 — add sandbox experimental helper
Fusion-Task-Id: FN-4650 Fusion-Task-Lineage: 3da8db80-236b-46f6-8122-644abda35ca3
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
PROJECT_SETTINGS_KEYS,
|
||||
SANDBOX_BACKEND_NAMES,
|
||||
SANDBOX_FAILURE_MODES,
|
||||
isSandboxExperimentalEnabled,
|
||||
validateSandboxBackendName,
|
||||
validateSandboxFailureMode,
|
||||
validateSandboxPolicy,
|
||||
@@ -102,4 +103,22 @@ describe("sandbox settings", () => {
|
||||
expect(validateSandboxProjectSettings("nope")).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("isSandboxExperimentalEnabled", () => {
|
||||
it("returns false for undefined settings", () => {
|
||||
expect(isSandboxExperimentalEnabled(undefined)).toBe(false);
|
||||
});
|
||||
|
||||
it("returns false when sandbox flag is missing", () => {
|
||||
expect(isSandboxExperimentalEnabled({ experimentalFeatures: {} })).toBe(false);
|
||||
});
|
||||
|
||||
it("returns false when sandbox flag is false", () => {
|
||||
expect(isSandboxExperimentalEnabled({ experimentalFeatures: { sandbox: false } })).toBe(false);
|
||||
});
|
||||
|
||||
it("returns true when sandbox flag is true", () => {
|
||||
expect(isSandboxExperimentalEnabled({ experimentalFeatures: { sandbox: true } })).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -877,6 +877,7 @@ export { isExperimentalFeatureEnabled } from "./experimental-features.js";
|
||||
export { isResearchExperimentalEnabled, resolveResearchSettings } from "./research-settings.js";
|
||||
export type { ResolvedResearchSettings } from "./research-settings.js";
|
||||
export { isEvalsExperimentalEnabled, resolveEvalSettings } from "./eval-settings.js";
|
||||
export { isSandboxExperimentalEnabled } from "./sandbox-settings.js";
|
||||
|
||||
export { TodoStore } from "./todo-store.js";
|
||||
export type { TodoStoreEvents } from "./todo-store.js";
|
||||
|
||||
6
packages/core/src/sandbox-settings.ts
Normal file
6
packages/core/src/sandbox-settings.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { isExperimentalFeatureEnabled } from "./experimental-features.js";
|
||||
import type { Settings } from "./types.js";
|
||||
|
||||
export function isSandboxExperimentalEnabled(settings: Partial<Settings> | undefined): boolean {
|
||||
return isExperimentalFeatureEnabled(settings, "sandbox");
|
||||
}
|
||||
Reference in New Issue
Block a user