"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_env_boolean = require('./boolean.js');
const require_env_rewire = require('./rewire.js');
const require_env_node_env = require('./node-env.js');
const require_env_string = require('./string.js');

//#region src/env/test.ts
/**
* @file Test environment variable getters and detection. Provides access to
*   test framework environment variables and utilities.
*/
/**
* JEST_WORKER_ID environment variable. Set when running tests with Jest.
*
* @example
*   ;```typescript
*   import { getJestWorkerId } from '@socketsecurity/lib/env/test'
*
*   const workerId = getJestWorkerId()
*   // e.g. '1' when running in Jest, or ''
*   ```
*
* @returns The Jest worker ID string, or empty string if not set
*/
/*@__NO_SIDE_EFFECTS__*/
function getJestWorkerId() {
	return /* @__PURE__ */ require_env_string.envAsString(require_env_rewire.getEnvValue("JEST_WORKER_ID"));
}
/**
* VITEST environment variable. Set when running tests with Vitest.
*
* @example
*   ;```typescript
*   import { getVitest } from '@socketsecurity/lib/env/test'
*
*   if (getVitest()) {
*     console.log('Running in Vitest')
*   }
*   ```
*
* @returns `true` if running in Vitest, `false` otherwise
*/
/*@__NO_SIDE_EFFECTS__*/
function getVitest() {
	return /* @__PURE__ */ require_env_boolean.envAsBoolean(require_env_rewire.getEnvValue("VITEST"));
}
/**
* Check if code is running in a test environment. Checks NODE_ENV, VITEST, and
* JEST_WORKER_ID.
*
* @example
*   ;```typescript
*   import { isTest } from '@socketsecurity/lib/env/test'
*
*   if (isTest()) {
*     console.log('Running in test environment')
*   }
*   ```
*
* @returns `true` if running in a test environment, `false` otherwise
*/
/*@__NO_SIDE_EFFECTS__*/
function isTest() {
	return /* @__PURE__ */ require_env_string.envAsString(/* @__PURE__ */ require_env_node_env.getNodeEnv()) === "test" || /* @__PURE__ */ getVitest() || !!/* @__PURE__ */ getJestWorkerId();
}

//#endregion
exports.getJestWorkerId = getJestWorkerId;
exports.getVitest = getVitest;
exports.isTest = isTest;