Skip to content

Latest commit

 

History

History
65 lines (37 loc) · 1.41 KB

protectedImportFactory.md

File metadata and controls

65 lines (37 loc) · 1.41 KB

elections-cpl.api.hscc.bdpa.orgDocs


elections-cpl.api.hscc.bdpa.org / test/setup / protectedImportFactory

Function: protectedImportFactory()

protectedImportFactory<T>(__namedParameters): (params?) => Promise<T>

Type parameters

T = unknown

Parameters

__namedParameters

__namedParameters.expectedExitCode?: number | "non-zero"

The code that must be passed to process.exit by the imported module. If undefined (default), then process.exit must not be called.

Default

undefined

__namedParameters.path: string

Path to the module to import. Module resolution is handled by require.

__namedParameters.useDefault?: boolean

By default, only if module.__esModule === true, the default export will be returned instead. Use useDefault to override this behavior in either direction.

Returns

Function

Parameters

params?

params.expectedExitCode?: number | "non-zero"

The code that must be passed to process.exit by the imported module. If undefined (default), then process.exit must not be called.

Default

undefined

Returns

Promise<T>

Source

test/setup.ts:363