h$Z      !"#$%&'()*+,-./0123456789:;<=>?@ABC Safe-Inferred#$'(?VDEFGHIJK Safe-Inferred#$'(?a typeable-mock-Helper for making polymorphic mock functions. typeable-mock=Description of what value for mock call the assertions expect typeable-mock5Mock configuration. When running production, use the # without adding mocks to it - it would call the real functions.The key or type of the mock created in a test suite may accidentally mismatch the key or type at the place where a mock is used. Silently calling the real functions would make the test suite fragile. So, when running on a test suite, protect against the mismatches by requiring that the mocks are present. Set - to return True or allow a few special cases: testMockConfig = defaultMockConfig { mcShouldFailOnNotFound = \\key tRep -> key ``notElem`` whitelist where -- Functions that are allowed to be called during tests. whitelist = ["readFile"] } typeable-mock0A map of mocks. The key of the inner map is the TypeRep- of the function supplied when making a mock. typeable-mock:Decide whether to throw an error when a mock is not found.$ typeable-mockWraps the function into a . For successful lookup at the call site, the type of the passed function must match the type of the mocked function.:If the mocked function has polymorphic arguments, such as print :: Show a => a -> IO (), create a mock for each case. For example, if an app prints Int and Strings, create two mocks:  mockConf <- + defaultConf <$> sequence [ makeMock "print" (const $ pure () :: Int -> IO ()), , makeMock "print" (const $ pure () :: String -> IO ()) ] For mocking functions with many arguments it is convenient to use  and L . Using L lets you omit the type annotation. These definitions create the same mock: makeMock "someAction" ((\_ _ _ -> pure "result") :: Arg1 -> Arg2 -> Arg3 -> SomeMonad ()) makeMock "someAction" ( $ pure "result" :: Arg1 -> Arg2 -> Arg3 -> SomeMonad ()) makeMock "someAction" ( $ pure "result" `L` someAction) % typeable-mockA helper function to lookup the function. Likely you want to write a wrapper that retrieves the  MockConfig from the environment. withMock :: String -> f -> AppMonad f withMock key f = do mockConf <- getMockConfig <$> getEnv pure $ fromMaybe f (lookupMockFunction mockConf key) withMock "getSomething" getSomething >>= \f -> f someArg& typeable-mock&Reuse the mocks between the test items' typeable-mock&Reuse the mocks between the test items( typeable-mockFind a mock by name. If there are several mocks under the same name, use ).) typeable-mockFind a mock by name and type.* typeable-mockBuild helpers using mocks in your application with this. The conversion is for the case when the type of a function stored in mock does not match the mocked function. Usually this is a case for a newtype wrapper over a polymorphic monad like MockMonadIO., typeable-mockUse this to create  Examples: $expectCall "email@example.com" True - typeable-mockAssert that mock returned the given result. Sometimes it is more convenient than checking arguments.. typeable-mock when the existing assert* functions are not flexible enough.3 typeable-mock%The family of functions unMockMonadIO N6 is specialized with the number of arguments. Unlike fromMockMonadIO , the monad m% can be polymorphic at the call site.8 typeable-mock+Changes the return type of a function from  MockMonadIO x to m x. The m must be a concrete type at the call site. If the caller is in a polymorphic monad, use one of the  unMockMonadIO N instead.* typeable-mockGet mock config from the context | Convert the mock function. Usually it is id5 or unwrapping function for an existential type like  MockMonadIO. typeable-mockKey of the mock typeable-mock!The function that is being mocked9  !"#$%&'()*+,-./0123456789#+$%!"   ()*./12,-0&'834567       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK,typeable-mock-0.1.0.0-BoeMg6xJNLKELXSpd7TOlSTest.TypeableMockPaths_typeable_mock0variadic-function-0.1.0.2-HW1aVYF3z6zGoN2M4Yj8BLData.Function.Variadic.UtilsconstN MockMonadIO unMockMonadIOExpectedCallRecord ExpectedValAnyVal PredicateValMockFailureReason MockFailureArgumentCountMismatchMockFailureArgumentTypeMismatch MockFailureArgumentValueMismatch#MockFailureArgumentPredicateFailureMockFailureUnexpectedCallMockFailureNotCalled MockFailuremfMock mfLocationmfReason MockConfig mcStoragemcShouldFailOnNotFoundMockmockKeymockCallRecord mockFunction ActualValActualCallRecorddefaultMockConfigmakeMocklookupMockFunctionresetMockCallRecordsresetAllCallRecords lookupMocklookupMockTypeduseMockConvertaddMocksToConfig expectCall withResultassertHasCallsassertNotCalled callMatches assertAnyCallgetCallsunMockMonadIO1unMockMonadIO2unMockMonadIO3unMockMonadIO4unMockMonadIO5fromMockMonadIO $fShowMock$fShowMockConfig$fShowExpectedVal$fEqExpectedVal$fShowMockFailureReason$fExceptionMockFailure$fShowMockFailure$fMonadIOMockMonadIO$fMonadMockMonadIO$fApplicativeMockMonadIO$fFunctorMockMonadIOversion getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNamebaseGHC.BaseasTypeOf