Skip to content
File

Blob: src/workerd/api/tests/autogate-enabled-test.js

javascript22 lines
1// Copyright (c) 2025 Cloudflare, Inc.
2// Licensed under the Apache 2.0 license found in the LICENSE file or at:
3// https://opensource.org/licenses/Apache-2.0
4// Test that verifies autogates are ENABLED.
5// This test only runs in the @all-autogates variant (default variant is disabled).
6 
7import { strictEqual } from 'node:assert';
8import unsafe from 'workerd:unsafe';
9 
10export const autogateEnabledTest = {
11 test() {
12 // In the @all-autogates variant, WORKERD_ALL_AUTOGATES env var is set,
13 // so isTestAutogateEnabled() should return true.
14 const isEnabled = unsafe.isTestAutogateEnabled();
15 strictEqual(
16 isEnabled,
17 true,
18 'TEST_WORKERD autogate should be ENABLED in @all-autogates variant'
19 );
20 },
21};