MCPcopy Create free account
hub / github.com/microsoft/vscode-cpptools / when

Function when

Extension/test/common/internal.ts:8–18  ·  view source on GitHub ↗
(prerequisite: boolean | (() => boolean))

Source from the content-addressed store, hash-verified

6import { is } from '../../src/Utility/System/guards';
7
8export function when(prerequisite: boolean | (() => boolean)): {it: Mocha.TestFunction} {
9 if (is.function(prerequisite)) {
10 prerequisite = prerequisite();
11 }
12 if (prerequisite) {
13 return {it};
14 } else {
15 const skip = (title: string, test: AsyncFunc | Func) => it.skip(`Dynamically skipping test: <<${title}>> - prerequisite not met.`, test);
16 return {it:skip as Mocha.TestFunction};
17 }
18}
19
20import { MessagePort } from 'worker_threads';
21import { collectGarbage } from '../../src/Utility/System/garbageCollector';

Callers 1

Calls 1

functionMethod · 0.80

Tested by

no test coverage detected