{"version":3,"file":"enhanced-expect.cjs","sources":["../../../src/run-assertions/enhanced-expect.js"],"sourcesContent":["import { allMatchers } from '../matchers/index.js';\nimport { isAsyncMatcherResult } from '../matchers/asyncMatcherWrapper.js';\n\n/**\n * Enhanced expect function that properly handles async matchers\n * @param {*} exp - The value to test\n * @returns {EnhancedMatchers} - Enhanced matchers with async support\n */\nexport function enhancedExpect(exp) {\n  const baseMatchers = allMatchers(exp);\n  \n  const handler = {\n    get(target, prop) {\n      const original = target[prop];\n      \n      if (typeof original === 'function') {\n        return (...args) => {\n          const result = original(...args);\n          \n          if (isAsyncMatcherResult(result)) {\n            return {\n              ...result,\n              \n              async executeAndHandle() {\n                try {\n                  await result.execute();\n                  return true;\n                } catch (error) {\n                  return false;\n                }\n              },\n              \n              async getResult() {\n                try {\n                  await result.execute();\n                  return { success: true };\n                } catch (error) {\n                  return { success: false, error };\n                }\n              },\n              \n              async executeAndThrowIfFailed() {\n                try {\n                  await result.execute();\n                  throw new Error('Async matcher succeeded but was expected to fail');\n                } catch (error) {\n                  throw error;\n                }\n              },\n              // Special handling for toThrow - when toThrow is called on an async matcher result\n              toThrow: function(expectedError) {\n                const asyncFunction = async () => {\n                  try {\n                    await result.execute();\n                    throw new Error('Async matcher succeeded but was expected to fail');\n                  } catch (error) {\n                    throw error;\n                  }\n                };\n                \n                return asyncFunction();\n              }\n            };\n          }\n          \n          return result;\n        };\n      }\n      \n      return original;\n    }\n  };\n  \n  return new Proxy(baseMatchers, handler);\n}\n\n/**\n * Helper function to check if a result is an async matcher result\n */\nexport function isAsyncMatcherResultWrapper(obj) {\n  return obj && obj.asyncMatcherResult && isAsyncMatcherResult(obj.asyncMatcherResult);\n} "],"names":["allMatchers","isAsyncMatcherResult"],"mappings":";;;;;AAGA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,GAAG,EAAE;AACpC,EAAE,MAAM,YAAY,GAAGA,iBAAW,CAAC,GAAG,CAAC;AACvC;AACA,EAAE,MAAM,OAAO,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