UNPKG

flagpole

Version:

Simple and fast DOM integration, headless or headful browser, and REST API testing framework.

41 lines 2.16 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const command_1 = require("../command"); const cli_1 = require("../cli"); const flagpole_execution_1 = require("../../flagpole-execution"); const cli_helper_1 = require("../cli-helper"); class Audit extends command_1.Command { constructor() { super(...arguments); this.commandString = "audit"; this.description = "find problems in Flagpole configuration, such as suites whose files do not exist"; } action() { return __awaiter(this, void 0, void 0, function* () { const suiteNames = (flagpole_execution_1.FlagpoleExecution.global.config.getSuiteNames() || []).sort(); const suitesInFolder = yield cli_helper_1.findJsFilesInTestFolder(); const suitesNotExisting = suiteNames.filter((x) => !suitesInFolder.includes(x)); cli_1.Cli.subheader("Audit Suites").log("Looking in folder: " + flagpole_execution_1.FlagpoleExecution.global.config.getTestsFolder(), ""); if (suitesNotExisting.length > 0) { cli_1.Cli.log("Found these test suites without matching files:") .list(suitesNotExisting) .log("") .exit(0); } else { cli_1.Cli.log("Did not find any suites whose file did not exist.").exit(2); } }); } } exports.default = Audit; //# sourceMappingURL=audit.js.map