UNPKG

jest-bdd-generator

Version:

Jest code generator empowered with Gherkin and BDD

20 lines (19 loc) 786 B
import { compose } from "../jest-to-gherkin"; import { run } from "./adapter"; import * as path from "path"; import * as fs from "fs"; const files = fs.readdirSync(path.join(process.cwd(), "./tests")); let defaultFileEntry; if (files[0]) { var _files__match; var _files__match_; defaultFileEntry = (_files__match_ = (_files__match = files[0].match(/(\w+)\.test\.ts/)) === null || _files__match === void 0 ? void 0 : _files__match[1]) !== null && _files__match_ !== void 0 ? _files__match_ : "index"; } const options = { pathTestsInput: path.join(process.cwd(), `./tests/${defaultFileEntry}.test.ts`), pathOutput: path.join(process.cwd(), `./docs/features/${defaultFileEntry}.feature`) }; void run(compose, options, [ "pathTestsInput" ]); //# sourceMappingURL=gen-doc.js.map