UNPKG

testeranto

Version:

the AI powered BDD test framework for typescript projects

40 lines (39 loc) 1.57 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MockCore = void 0; /* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-explicit-any */ const core_1 = __importDefault(require("../core")); /** * Concrete implementation of Testeranto for testing purposes */ class MockCore extends core_1.default { constructor(input, testSpecification, testImplementation, testResourceRequirement = { ports: [] }, testAdapter, uberCatcher = (cb) => cb()) { // Validate required implementation methods const requiredMethods = ["suites", "givens", "whens", "thens"]; requiredMethods.forEach((method) => { if (!testImplementation[method]) { throw new Error(`Missing required implementation method: ${method}`); } }); // this.testResourceRequirement = testResourceRequirement; // this.testAdapter = testAdapter; super(input, testSpecification, testImplementation, testResourceRequirement, testAdapter, uberCatcher); this.specs = []; this.testJobs = []; this.artifacts = []; } async receiveTestResourceConfig(partialTestResource) { return { failed: false, fails: 0, artifacts: [], // logPromise: Promise.resolve(), features: [], }; } } exports.MockCore = MockCore;