@itwin/core-backend
Version:
iTwin.js backend components
54 lines • 2.47 kB
TypeScript
import { IModelHostOptions } from "../IModelHost";
/** Class for simple test timing */
export declare class Timer {
private _label;
private _start;
constructor(label: string);
end(): void;
}
/**
* Disables native code assertions from firing. This can be used by tests that intentionally
* test failing operations. If those failing operations raise assertions in native code, the test
* would fail unexpectedly in a debug build. In that case the native code assertions can be disabled with
* this class.
*/
export declare class DisableNativeAssertions implements Disposable {
private _native;
constructor();
[Symbol.dispose](): void;
/** @deprecated in 5.0 - might be removed in next major version. Use [Symbol.dispose] instead. */
dispose(): void;
}
export declare class TestUtils {
private static shouldLogToConsole;
static getCacheDir(fallback?: string | undefined): string | undefined;
/** Handles the startup of IModelHost for unit tests.
* The provided config is used and will override any of the default values used in this method.
*
* The default includes:
* - cacheDir = path.join(__dirname, ".cache")
* - allowSharedChannel = false;
*
* GCS (Geographic Coordinate System) workspace loading is disabled by default, since unit tests
* should not make network requests. Pass `loadGcsWorkspaces: true` for the rare test that genuinely
* needs GCS data (which then belongs in the integration suite). This flag is test-only and is not
* forwarded to `IModelHost.startup`.
*/
static startBackend(config?: IModelHostOptions & {
loadGcsWorkspaces?: boolean;
}): Promise<void>;
/**
* Suppress loading of Geographic Coordinate System (GCS) workspaces from cloud containers (and the
* network requests they issue when iModels are opened) by overriding the existing GeoCoordConfig
* setting. Unit tests should not make network calls; tests that genuinely require GCS data belong
* in the integration suite. GCS workspaces load lazily on first iModel open, so overriding the
* setting any time after `IModelHost.startup` is sufficient.
*/
static disableGcsWorkspaces(): void;
static shutdownBackend(): Promise<void>;
static setupLogging(): void;
private static initDebugLogLevels;
static setupDebugLogLevels(): void;
static resetDebugLogLevels(): void;
}
//# sourceMappingURL=TestUtils.d.ts.map