MCPcopy
hub / github.com/PowerShell/vscode-powershell / stubInterface

Function stubInterface

test/utils.ts:94–96  ·  view source on GitHub ↗
(object?: Partial<T>)

Source from the content-addressed store, hash-verified

92 * This is a workaround for sinon not being able to stub interfaces. Interfaces are a TypeScript-only concept so this effectively allows us to stub interfaces by not providing the entire implementation but only what matters for the test. "What matters" is not type checked so you must be careful to stub everything you need, otherwise you should provide a default implementation instead if you do not know.
93 */
94export function stubInterface<T>(object?: Partial<T>): T {
95 return object ? (object as T) : ({} as T);
96}
97
98/** Builds the sample binary module code. We need to do this because the source maps have absolute paths so they are not portable between machines, and while we could do deterministic with source maps, that's way more complicated and everywhere we build has dotnet already anyways */
99export function BuildBinaryModuleMock(): void {

Callers 2

Calls

no outgoing calls

Tested by 1