MCPcopy Create free account
hub / github.com/Snapchat/Valdi / itIntegratesBasic

Function itIntegratesBasic

valdi/vscode_debugger/src/test/testIntegrationUtils.ts:50–77  ·  view source on GitHub ↗
(
  test: string,
  fn: (s: IIntegrationState) => Promise<void> | void,
  testFunction: TestFunction | ExclusiveTestFunction = it,
)

Source from the content-addressed store, hash-verified

48}
49
50const itIntegratesBasic = (
51 test: string,
52 fn: (s: IIntegrationState) => Promise<void> | void,
53 testFunction: TestFunction | ExclusiveTestFunction = it,
54) =>
55 testFunction(test, async function () {
56 const golden = new GoldenText(this.test!.titlePath().join(' '), testWorkspace);
57 const root = new TestRoot(golden, this.test!.fullTitle());
58 await root.initialize;
59
60 try {
61 (this.test as IGoldenReporterTextTest).goldenText = golden;
62
63 await fn({ golden, r: root, context: this as Mocha.Context & { test: Mocha.Runnable } });
64 } finally {
65 try {
66 await root.disconnect();
67 } catch (e) {
68 console.warn('Error disconnecting test root:', e);
69 }
70 }
71
72 if (golden.hasNonAssertedLogs()) {
73 throw new Error(
74 `Whoa, test "${test}" has some logs that it did not assert!\n\n${golden.getOutput()}`,
75 );
76 }
77 });
78
79itIntegratesBasic.only = (test: string, fn: (s: IIntegrationState) => Promise<void> | void) =>
80 itIntegratesBasic(test, fn, it.only);

Callers 1

Calls 6

disconnectMethod · 0.95
hasNonAssertedLogsMethod · 0.95
getOutputMethod · 0.95
warnMethod · 0.65
fnFunction · 0.50
joinMethod · 0.45

Tested by

no test coverage detected