qa360 2.1.2 → 2.1.3

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.
@@ -3,7 +3,7 @@
3
3
  * CLI interface for Evidence Vault querying and management
4
4
  */
5
5
  import { Command } from 'commander';
6
- import { existsSync, createWriteStream, readFileSync } from 'fs';
6
+ import { existsSync, createWriteStream, readFileSync, statSync, readdirSync, unlinkSync } from 'fs';
7
7
  import { join } from 'path';
8
8
  import chalk from 'chalk';
9
9
  import AdmZip from 'adm-zip';
@@ -434,7 +434,7 @@ export class QA360History {
434
434
  console.log(chalk.gray(' ✓ verification data'));
435
435
  // 6. Write ZIP file
436
436
  zip.writeZip(options.bundle);
437
- const stats = require('fs').statSync(options.bundle);
437
+ const stats = statSync(options.bundle);
438
438
  const sizeKB = (stats.size / 1024).toFixed(2);
439
439
  console.log(chalk.green(`\n✅ Bundle exported successfully!`));
440
440
  console.log(chalk.gray(`📦 ${options.bundle} (${sizeKB} KB)`));
@@ -479,8 +479,6 @@ export class QA360History {
479
479
  let orphanedCount = 0;
480
480
  let orphanedSize = 0;
481
481
  if (existsSync(casDir)) {
482
- const { readdirSync, statSync, unlinkSync } = require('fs');
483
- const { join } = require('path');
484
482
  // Scan CAS directory
485
483
  const scanCAS = (dir) => {
486
484
  const entries = readdirSync(dir);
@@ -57,7 +57,7 @@ export const GATE_DESCRIPTIONS = {
57
57
  'api-smoke': {
58
58
  short: 'API smoke tests (REST/GraphQL health checks)',
59
59
  beginner: 'Tests if your API is alive and responds correctly. Like checking if the server is up.',
60
- example: 'Checks if GET /api/health returns 200 OK',
60
+ example: 'Checks if GET /api/health or GET /status/200 returns 200 OK',
61
61
  icon: '🔌',
62
62
  adapter: 'playwright-api',
63
63
  },
@@ -155,8 +155,9 @@ function generateV2Pack(name, gates, apiTarget, webTarget) {
155
155
  case 'api-smoke':
156
156
  pack.gates['api-health'] = createGate('playwright-api', apiBaseUrl, {
157
157
  smoke: [
158
- 'GET /health -> 200',
159
- 'GET /status -> 200',
158
+ 'GET /status/200 -> 200',
159
+ 'GET /get -> 200',
160
+ 'GET /uuid -> 200',
160
161
  ],
161
162
  });
162
163
  break;
@@ -245,6 +245,10 @@ export class PlaywrightNativeApiAdapter {
245
245
  * Format: "GET /path -> 200" or "POST /api/users -> 201"
246
246
  */
247
247
  parseTestSpec(spec, baseUrl) {
248
+ // Validate baseUrl first
249
+ if (!baseUrl || typeof baseUrl !== 'string') {
250
+ throw new Error('baseUrl is required in gate configuration. Add "baseUrl: https://your-api.com" to the config section.');
251
+ }
248
252
  const match = spec.match(/^(\w+)\s+(.+?)\s*->\s*(\d+)$/);
249
253
  if (!match) {
250
254
  throw new Error(`Invalid test spec format: ${spec}. Expected: "METHOD /path -> STATUS"`);
@@ -347,14 +351,14 @@ export class PlaywrightNativeApiAdapter {
347
351
  static validateConfig(target) {
348
352
  const errors = [];
349
353
  if (!target.baseUrl) {
350
- errors.push('API target requires baseUrl');
354
+ errors.push('baseUrl is required in gate config. Add: "baseUrl: https://your-api.com"');
351
355
  }
352
356
  else {
353
357
  try {
354
358
  new URL(target.baseUrl);
355
359
  }
356
360
  catch {
357
- errors.push('API target baseUrl must be a valid URL');
361
+ errors.push(`baseUrl "${target.baseUrl}" is not a valid URL. Expected format: https://api.example.com`);
358
362
  }
359
363
  }
360
364
  if (target.smoke) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qa360",
3
- "version": "2.1.2",
3
+ "version": "2.1.3",
4
4
  "description": "QA360 Proof CLI - Quality as Cryptographic Proof",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -45,7 +45,6 @@
45
45
  "ollama": "^0.5.1",
46
46
  "ora": "^5.4.1",
47
47
  "playwright": "^1.57.0",
48
-
49
48
  "sqlite3": "^5.1.6",
50
49
  "tweetnacl": "^1.0.3"
51
50
  },