Skip to content

Function: createJestConfig()

ts
function createJestConfig(overrides?: IXrayJestConfigOverrides): Record<string, unknown>;

Build a Jest configuration for testing X-Ray TypeScriptToLua script code.

The generated config maps the bare xray16 module to the shipped runtime stand-in and registers the SDK setup files. The setupFiles entry installs Lua-like globals through setupLuaGlobals and registers the xray16 module mock through setupXrayRuntime; the setupFilesAfterEnv entry registers the custom jest matchers through extendJest (add xray16/typedefs/jest to compilerOptions.types for their types).

The xray16/lib, xray16/mocks, xray16/alias, and xray16/macros subpaths resolve through package exports and need no mapper entry.

Parameters

ParameterTypeDescription
overridesIXrayJestConfigOverridesConsumer Jest config values to merge over the SDK defaults.

Returns

Record<string, unknown>

A Jest config object.