UNPKG

@wix-pilot/core

Version:

A flexible plugin that drives your tests with human-written commands, enhanced by the power of large language models (LLMs)

23 lines (22 loc) 721 B
"use strict"; /** * Utility functions for working with Jest */ Object.defineProperty(exports, "__esModule", { value: true }); exports.getCurrentJestTestFilePath = getCurrentJestTestFilePath; /** * Gets the current test file path from Jest's globals * @returns The current Jest test file path, or undefined if not in Jest */ function getCurrentJestTestFilePath() { if ( // @ts-expect-error - Jest global typeof globalThis.expect === "function" && // @ts-expect-error - Jest global typeof globalThis.expect.getState === "function") { // @ts-expect-error - Jest global const { testPath } = globalThis.expect.getState(); return testPath; } return undefined; }