@boolesai/tspec-cli 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -86,6 +86,13 @@ function formatTestResult(result, verbose = false) {
86
86
  output += "\n" + assertionLines.join("\n");
87
87
  }
88
88
  }
89
+ if (verbose && result.extracted && Object.keys(result.extracted).length > 0) {
90
+ output += "\n" + chalk.gray(" Extracted:");
91
+ for (const [key, value] of Object.entries(result.extracted)) {
92
+ output += `
93
+ ${key}: ${JSON.stringify(value)}`;
94
+ }
95
+ }
89
96
  return output;
90
97
  }
91
98
  function formatTestSummary(summary) {
@@ -131,7 +138,16 @@ function formatParsedTestCase(testCase, options = {}) {
131
138
  const lines = [];
132
139
  lines.push(chalk.bold(`Test Case: ${tc.id || "unknown"}`));
133
140
  if (tc.description) lines.push(` Description: ${tc.description}`);
134
- if (tc.type) lines.push(` Protocol: ${tc.type}`);
141
+ if (tc.protocol) lines.push(` Protocol: ${tc.protocol}`);
142
+ if (tc.lifecycle) {
143
+ const lifecycle = tc.lifecycle;
144
+ if (lifecycle.setup?.length) {
145
+ lines.push(` Lifecycle Setup: ${lifecycle.setup.length} action(s)`);
146
+ }
147
+ if (lifecycle.teardown?.length) {
148
+ lines.push(` Lifecycle Teardown: ${lifecycle.teardown.length} action(s)`);
149
+ }
150
+ }
135
151
  return lines.join("\n");
136
152
  }
137
153
  let globalOptions = {};
@@ -236,6 +252,7 @@ function formatResult(result) {
236
252
  testCaseId: result.testCaseId,
237
253
  passed: result.passed,
238
254
  duration: result.duration,
255
+ extracted: Object.keys(result.extracted).length > 0 ? result.extracted : void 0,
239
256
  assertions: result.assertions.map((a) => ({
240
257
  passed: a.passed,
241
258
  type: a.type,