jest-bdd-generator
Version:
Jest code generator empowered with Gherkin and BDD
17 lines (16 loc) • 698 B
JavaScript
import { generateComments } 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`)
};
void run(generateComments, options);
//# sourceMappingURL=gen-comments.js.map